summaryrefslogtreecommitdiff
path: root/Zend/tests/gc_011.phpt
blob: d11d7b6b46e4dd5492c2b963c4c040344652c9aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--TEST--
GC 011: GC and destructors
--INI--
zend.enable_gc=1
--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());
var_dump(gc_collect_cycles());
echo "ok\n"
?>
--EXPECTF--
object(Foo)#%d (1) {
  ["a"]=>
  *RECURSION*
}
__destruct
int(0)
int(1)
ok