xref: /PHP-5.3/Zend/tests/gc_009.phpt (revision a140e706)
1--TEST--
2GC 009: Unreferensed array-object cycle
3--INI--
4zend.enable_gc=1
5--FILE--
6<?php
7$a = array();
8$a[0] = new stdClass();
9$a[0]->a = array();
10$a[0]->a[0] =& $a[0];
11var_dump($a[0]);
12var_dump(gc_collect_cycles());
13unset($a);
14var_dump(gc_collect_cycles());
15echo "ok\n"
16?>
17--EXPECTF--
18object(stdClass)#%d (1) {
19  ["a"]=>
20  array(1) {
21    [0]=>
22    *RECURSION*
23  }
24}
25int(0)
26int(2)
27ok
28