gc_042.phpt 403 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. Object properties HT may need to be removed from nested data
  3. --FILE--
  4. <?php
  5. class Test {
  6. public function __destruct() {
  7. $GLOBALS['x'] = $this;
  8. }
  9. }
  10. $t = new Test;
  11. $t->x = new stdClass;
  12. $t->x->t = $t;
  13. $a = (array) $t->x;
  14. unset($t, $a);
  15. gc_collect_cycles();
  16. var_dump($x);
  17. ?>
  18. --EXPECT--
  19. object(Test)#1 (1) {
  20. ["x"]=>
  21. object(stdClass)#2 (1) {
  22. ["t"]=>
  23. *RECURSION*
  24. }
  25. }