xref: /PHP-8.1/Zend/tests/errmsg_003.phpt (revision f8d79582)
1--TEST--
2errmsg: cannot reassign $this (by ref)
3--FILE--
4<?php
5
6class test {
7    function foo() {
8        $a = new test;
9        $this = &$a;
10    }
11}
12
13$t = new test;
14$t->foo();
15
16echo "Done\n";
17?>
18--EXPECTF--
19Fatal error: Cannot re-assign $this in %s on line %d
20