bug72177.phpt 530 B

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. Bug #72177 Scope issue in __destruct after ReflectionProperty::setValue()
  3. --FILE--
  4. <?php
  5. class Child
  6. {
  7. protected $bar;
  8. public function __destruct()
  9. {
  10. $this->bar = null;
  11. }
  12. }
  13. class Parnt
  14. {
  15. protected $child;
  16. public function doSomething()
  17. {
  18. $this->child = new Child();
  19. $prop = new \ReflectionProperty($this, 'child');
  20. $prop->setAccessible(true);
  21. $prop->setValue($this, null);
  22. }
  23. }
  24. $p = new Parnt();
  25. $p->doSomething();
  26. echo "OK\n";
  27. ?>
  28. --EXPECT--
  29. OK