php-src/Zend/tests/gc_011.phpt

30 lines
388 B
Plaintext
Raw Normal View History

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