php-src/Zend/tests/gc_016.phpt
2020-02-03 22:52:20 +01:00

29 lines
410 B
PHP

--TEST--
GC 016: nested GC calls
--INI--
zend.enable_gc=1
--FILE--
<?php
class Foo {
public $a;
function __destruct() {
echo "-> ";
$a = array();
$a[] =& $a;
unset($a);
var_dump(gc_collect_cycles());
}
}
$a = new Foo();
$a->a = $a;
unset($a);
var_dump(gc_collect_cycles());
var_dump(gc_collect_cycles());
echo "ok\n"
?>
--EXPECT--
-> int(0)
int(0)
int(2)
ok