php-src/Zend/tests/gc_011.phpt

28 lines
335 B
Plaintext
Raw Normal View History

2008-01-22 17:27:48 +08:00
--TEST--
GC 011: GC and destructors
2010-03-04 01:53:15 +08:00
--INI--
zend.enable_gc=1
2008-01-22 17:27:48 +08:00
--FILE--
<?php
class Foo {
public $a;
function __destruct() {
echo __FUNCTION__,"\n";
}
}
$a = new Foo();
$a->a = $a;
var_dump($a);
unset($a);
var_dump(gc_collect_cycles());
echo "ok\n"
?>
--EXPECTF--
object(Foo)#%d (1) {
2008-01-22 17:27:48 +08:00
["a"]=>
*RECURSION*
2008-01-22 17:27:48 +08:00
}
__destruct
int(1)
ok