mirror of
https://github.com/php/php-src.git
synced 2024-12-18 06:21:41 +08:00
7aacc705d0
Closes GH-5958
28 lines
393 B
PHP
28 lines
393 B
PHP
--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)
|