xref: /PHP-8.0/Zend/tests/foreach_002.phpt (revision ae6f45ad)
1--TEST--
2Creating recursive array on foreach using same variable
3--INI--
4zend.enable_gc=1
5--FILE--
6<?php
7
8error_reporting(E_ALL);
9
10foreach (($a = array('a' => array('a' => &$a))) as $a) {
11    var_dump($a);
12}
13
14?>
15--EXPECT--
16array(1) {
17  ["a"]=>
18  *RECURSION*
19}
20