summaryrefslogtreecommitdiff
path: root/tests/lang/foreachLoop.006.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lang/foreachLoop.006.phpt')
-rw-r--r--tests/lang/foreachLoop.006.phpt11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/lang/foreachLoop.006.phpt b/tests/lang/foreachLoop.006.phpt
new file mode 100644
index 0000000..a90f924
--- /dev/null
+++ b/tests/lang/foreachLoop.006.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Foreach loop tests - error case: key is a reference.
+--FILE--
+<?php
+$a = array("a","b","c");
+foreach ($a as &$k=>$v) {
+ var_dump($v);
+}
+?>
+--EXPECTF--
+Fatal error: Key element cannot be a reference in %s on line 3 \ No newline at end of file