diff options
Diffstat (limited to 'Zend/tests/foreach_005.phpt')
-rw-r--r-- | Zend/tests/foreach_005.phpt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Zend/tests/foreach_005.phpt b/Zend/tests/foreach_005.phpt new file mode 100644 index 0000000000..6ed9fe940b --- /dev/null +++ b/Zend/tests/foreach_005.phpt @@ -0,0 +1,22 @@ +--TEST-- +Nested foreach by reference on the same array +--FILE-- +<?php +$a = [1,2,3]; +foreach($a as &$x) { + foreach($a as &$y) { + echo "$x-$y\n"; + $y++; + } +} +?> +--EXPECT-- +1-1 +2-2 +2-3 +3-2 +3-3 +4-4 +5-3 +5-4 +5-5 |