diff options
Diffstat (limited to 'Zend/tests/gc_041.phpt')
-rw-r--r-- | Zend/tests/gc_041.phpt | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Zend/tests/gc_041.phpt b/Zend/tests/gc_041.phpt new file mode 100644 index 0000000000..7400e23756 --- /dev/null +++ b/Zend/tests/gc_041.phpt @@ -0,0 +1,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* + } +}
\ No newline at end of file |