summaryrefslogtreecommitdiff
path: root/ext/spl/tests/SplFixedArray_nested_foreach.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/tests/SplFixedArray_nested_foreach.phpt')
-rw-r--r--ext/spl/tests/SplFixedArray_nested_foreach.phpt19
1 files changed, 19 insertions, 0 deletions
diff --git a/ext/spl/tests/SplFixedArray_nested_foreach.phpt b/ext/spl/tests/SplFixedArray_nested_foreach.phpt
new file mode 100644
index 0000000000..0042ab7890
--- /dev/null
+++ b/ext/spl/tests/SplFixedArray_nested_foreach.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Nested iteration of SplFixedArray using foreach loops
+--FILE--
+<?php
+
+$array = SplFixedArray::fromArray([0, 1]);
+
+foreach ($array as $value1) {
+ foreach ($array as $value2) {
+ echo "$value1 $value2\n";
+ }
+}
+
+?>
+--EXPECT--
+0 0
+0 1
+1 0
+1 1