blob: 985264c770029f5170634fca9d6b34ea251b3283 (
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
|
--TEST--
GC 035: Lost inner-cycles garbage
--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(2)
int(0)
|