summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-01-29 21:43:28 +0300
committerDmitry Stogov <dmitry@zend.com>2015-01-29 21:43:28 +0300
commit721fc9e80d2ee8f2cd79c8c3cdceffae2c72de92 (patch)
tree684b2308a91ac21f2a56c573694331dd2fda7efc
parent15a23b1218b3e38630d677751a975907daa2cd54 (diff)
downloadphp-git-721fc9e80d2ee8f2cd79c8c3cdceffae2c72de92.tar.gz
Added new test
-rw-r--r--Zend/tests/foreach_008.phpt21
1 files changed, 21 insertions, 0 deletions
diff --git a/Zend/tests/foreach_008.phpt b/Zend/tests/foreach_008.phpt
new file mode 100644
index 0000000000..c68bcd89da
--- /dev/null
+++ b/Zend/tests/foreach_008.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Nested foreach by reference and array modification
+--FILE--
+<?php
+$a = [0, 1, 2, 3];
+foreach ($a as &$x) {
+ foreach ($a as &$y) {
+ echo "$x - $y\n";
+ if ($x == 0 && $y == 1) {
+ unset($a[2]);
+ unset($a[1]);
+ }
+ }
+}
+?>
+--EXPECT--
+0 - 0
+0 - 1
+0 - 3
+3 - 0
+3 - 3