xref: /PHP-8.0/Zend/tests/this_reassign.phpt (revision f8d79582)
1--TEST--
2$this re-assign
3--FILE--
4<?php
5function foo() {
6    $a = "this";
7    $$a = 0;
8    var_dump($$a);
9}
10foo();
11?>
12--EXPECTF--
13Fatal error: Uncaught Error: Cannot re-assign $this in %sthis_reassign.php:4
14Stack trace:
15#0 %sthis_reassign.php(7): foo()
16#1 {main}
17  thrown in %sthis_reassign.php on line 4
18