xref: /php-src/Zend/tests/foreach/foreach_008.phpt (revision 275f63e7)
1--TEST--
2Nested foreach by reference and array modification
3--FILE--
4<?php
5$a = [0, 1, 2, 3];
6foreach ($a as &$x) {
7    foreach ($a as &$y) {
8        echo "$x - $y\n";
9        if ($x == 0 && $y == 1) {
10            unset($a[2]);
11            unset($a[1]);
12        }
13    }
14}
15?>
16--EXPECT--
170 - 0
180 - 1
190 - 3
203 - 0
213 - 3
22