1
0
mirror of https://github.com/php/php-src.git synced 2026-04-16 20:41:18 +02:00
Files
archived-php-src/Zend/tests/gc_016.phpt
Dmitry Stogov fd348ec43f GC improvement
2018-03-01 03:17:21 +03:00

29 lines
371 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(1)
int(1)
ok