mirror of
https://github.com/php/php-src.git
synced 2024-11-26 03:16:33 +08:00
27 lines
333 B
PHP
27 lines
333 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());
|
|
echo "ok\n"
|
|
?>
|
|
--EXPECT--
|
|
-> int(1)
|
|
int(1)
|
|
ok
|