summaryrefslogtreecommitdiff
path: root/Zend/tests/gc_041.phpt
blob: 7400e237568ca257f428c1b77ba0df17cb69585e (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
30
31
32
33
34
35
--TEST--
GC 041: Handling of references in nested data of objects with destructor
--INI--
zend.enable_gc = 1
--FILE--
<?php
class ryat {
	    var $ryat;
        var $chtg;
        var $nested;
	    function __destruct() {
	            $GLOBALS['x'] = $this;
        }
}
$o = new ryat;
$o->nested = [];
$o->nested[] =& $o->nested;
$o->ryat = $o;
$x =& $o->chtg;
unset($o);
gc_collect_cycles();
var_dump($x);
?>
--EXPECT--
object(ryat)#1 (3) {
  ["ryat"]=>
  *RECURSION*
  ["chtg"]=>
  *RECURSION*
  ["nested"]=>
  &array(1) {
    [0]=>
    *RECURSION*
  }
}