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