bug30146.phpt 358 B

123456789101112131415161718192021
  1. --TEST--
  2. Reflection Bug #30146 (ReflectionProperty->getValue() requires instance for static property)
  3. --FILE--
  4. <?php
  5. class test {
  6. static public $a = 1;
  7. }
  8. $r = new ReflectionProperty('test', 'a');
  9. var_dump($r->getValue(null));
  10. $r->setValue(NULL, 2);
  11. var_dump($r->getValue());
  12. $r->setValue(3);
  13. var_dump($r->getValue());
  14. ?>
  15. --EXPECT--
  16. int(1)
  17. int(2)
  18. int(3)