php-src/Zend/tests/gc_032.phpt
Rasmus Lerdorf 388624d359 These tests all have intentional circular references
and they will leak and cause failures unless gc is enabled
2015-01-24 16:06:18 -08:00

43 lines
628 B
PHP

--TEST--
GC 032: Crash in GC because of invalid reference counting
--INI--
zend.enable_gc=1
--FILE--
<?php
$a = array();
$b =& $a;
$a[0] = $a;
debug_zval_dump($a);
$a = array(array());
$b =& $a;
$a[0][0] = $a;
debug_zval_dump($a);
?>
--EXPECTF--
array(1) refcount(%d){
[0]=>
array(1) refcount(%d){
[0]=>
array(1) refcount(%d){
[0]=>
*RECURSION*
}
}
}
array(1) refcount(%d){
[0]=>
array(1) refcount(%d){
[0]=>
array(1) refcount(%d){
[0]=>
array(1) refcount(%d){
[0]=>
array(1) refcount(%d){
[0]=>
*RECURSION*
}
}
}
}
}