bug53915.phpt 419 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. Bug #53915 - ReflectionClass::getConstant(s) emits fatal error on selfreferencing constants
  3. --FILE--
  4. <?php
  5. Class Foo
  6. {
  7. const A = 1;
  8. const B = self::A;
  9. }
  10. $rc = new ReflectionClass('Foo');
  11. print_r($rc->getConstants());
  12. Class Foo2
  13. {
  14. const A = 1;
  15. const B = self::A;
  16. }
  17. $rc = new ReflectionClass('Foo2');
  18. print_r($rc->getConstant('B'));
  19. ?>
  20. --EXPECT--
  21. Array
  22. (
  23. [A] => 1
  24. [B] => 1
  25. )
  26. 1