bug79487.phpt 549 B

12345678910111213141516171819202122232425262728293031323334
  1. --TEST--
  2. Bug #79487 (::getStaticProperties() ignores property modifications)
  3. --FILE--
  4. <?php
  5. class Foo {
  6. public static $bar = 'orig';
  7. }
  8. Foo::$bar = 'new';
  9. $rc = new ReflectionClass('Foo');
  10. var_dump($rc->getStaticProperties());
  11. class A {
  12. public static $a = 'A old';
  13. }
  14. class B extends A {
  15. public static $b = 'B old';
  16. }
  17. $rc = new ReflectionClass(B::class);
  18. A::$a = 'A new';
  19. var_dump($rc->getStaticProperties());
  20. ?>
  21. --EXPECT--
  22. array(1) {
  23. ["bar"]=>
  24. string(3) "new"
  25. }
  26. array(2) {
  27. ["b"]=>
  28. string(5) "B old"
  29. ["a"]=>
  30. string(5) "A new"
  31. }