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