xref: /PHP-7.2/Zend/tests/gc_016.phpt (revision e24fff2d)
1--TEST--
2GC 016: nested GC calls
3--INI--
4zend.enable_gc=1
5--FILE--
6<?php
7class Foo {
8	public $a;
9	function __destruct() {
10		echo "-> ";
11		$a = array();
12		$a[] =& $a;
13		unset($a);
14		var_dump(gc_collect_cycles());
15	}
16}
17$a = new Foo();
18$a->a = $a;
19unset($a);
20var_dump(gc_collect_cycles());
21echo "ok\n"
22?>
23--EXPECT--
24-> int(1)
25int(1)
26ok
27