xref: /php-src/Zend/tests/gc/gc_035.phpt (revision 275f63e7)
1--TEST--
2GC 035: Lost inner-cycles garbage
3--INI--
4zend.enable_gc = 1
5--FILE--
6<?php
7class A {
8    public $a;
9    public $x;
10    function __destruct() {
11        unset($this->x);
12    }
13}
14$a = new A;
15$a->a = $a;
16$a->x = [];
17$a->x[] =& $a->x;
18$a->x[] = $a;
19var_dump(gc_collect_cycles());
20unset($a);
21var_dump(gc_collect_cycles());
22?>
23--EXPECT--
24int(0)
25int(2)
26