bug37816.phpt 270 B

12345678910111213141516171819
  1. --TEST--
  2. Bug #37816 (ReflectionProperty does not throw exception when accessing protected attribute)
  3. --FILE--
  4. <?php
  5. class TestClass
  6. {
  7. protected $p = 2;
  8. }
  9. $o = new TestClass;
  10. $r = new ReflectionProperty($o, 'p');
  11. var_dump($r->getValue($o));
  12. ?>
  13. --EXPECT--
  14. int(2)