php-src/Zend/tests/foreach_002.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

23 lines
289 B
PHP

--TEST--
Creating recursive array on foreach using same variable
--INI--
zend.enable_gc=1
--FILE--
<?php
error_reporting(E_ALL);
foreach (($a = array('a' => array('a' => &$a))) as $a) {
var_dump($a);
}
?>
--EXPECT--
array(1) {
["a"]=>
&array(1) {
["a"]=>
*RECURSION*
}
}