diff options
Diffstat (limited to 'tests/lang/foreachLoop.008.phpt')
-rw-r--r-- | tests/lang/foreachLoop.008.phpt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/lang/foreachLoop.008.phpt b/tests/lang/foreachLoop.008.phpt new file mode 100644 index 0000000..787f43b --- /dev/null +++ b/tests/lang/foreachLoop.008.phpt @@ -0,0 +1,10 @@ +--TEST--
+Foreach loop tests - error case: reference to constant array, with key.
+--FILE--
+<?php
+foreach (array(1,2) as $k=>&$v) {
+ var_dump($v);
+}
+?>
+--EXPECTF--
+Fatal error: Cannot create references to elements of a temporary array expression in %s on line 2
|