xref: /php-src/Zend/tests/gc/gc_016.phpt (revision 275f63e7)
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(0)
25int(2)
26ok
27