bug72177.phpt 494 B

12345678910111213141516171819202122232425262728293031323334
  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->setValue($this, null);
  21. }
  22. }
  23. $p = new Parnt();
  24. $p->doSomething();
  25. echo "OK\n";
  26. ?>
  27. --EXPECT--
  28. OK