summaryrefslogtreecommitdiff
path: root/Zend/tests/this_in_foreach_004.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/this_in_foreach_004.phpt')
-rw-r--r--Zend/tests/this_in_foreach_004.phpt11
1 files changed, 11 insertions, 0 deletions
diff --git a/Zend/tests/this_in_foreach_004.phpt b/Zend/tests/this_in_foreach_004.phpt
new file mode 100644
index 0000000000..13bfbf18b4
--- /dev/null
+++ b/Zend/tests/this_in_foreach_004.phpt
@@ -0,0 +1,11 @@
+--TEST--
+$this in foreach
+--FILE--
+<?php
+$a = [[1]];
+foreach ($a as list($this)) {
+ var_dump($this);
+}
+?>
+--EXPECTF--
+Fatal error: Cannot re-assign $this in %sthis_in_foreach_004.php on line 3