xref: /PHP-8.1/Zend/tests/foreach_005.phpt (revision f8d79582)
1--TEST--
2Nested foreach by reference on the same array
3--FILE--
4<?php
5$a = [1,2,3];
6foreach($a as &$x) {
7    foreach($a as &$y) {
8        echo "$x-$y\n";
9        $y++;
10    }
11}
12?>
13--EXPECT--
141-1
152-2
162-3
173-2
183-3
194-4
205-3
215-4
225-5
23