summaryrefslogtreecommitdiff
path: root/Zend/tests/this_reassign.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/this_reassign.phpt')
-rw-r--r--Zend/tests/this_reassign.phpt17
1 files changed, 17 insertions, 0 deletions
diff --git a/Zend/tests/this_reassign.phpt b/Zend/tests/this_reassign.phpt
new file mode 100644
index 0000000000..d965ef4701
--- /dev/null
+++ b/Zend/tests/this_reassign.phpt
@@ -0,0 +1,17 @@
+--TEST--
+$this re-assign
+--FILE--
+<?php
+function foo() {
+ $a = "this";
+ $$a = 0;
+ var_dump($$a);
+}
+foo();
+?>
+--EXPECTF--
+Fatal error: Uncaught Error: Cannot re-assign $this in %sthis_reassign.php:4
+Stack trace:
+#0 %sthis_reassign.php(7): foo()
+#1 {main}
+ thrown in %sthis_reassign.php on line 4