xref: /PHP-8.2/Zend/tests/this_in_catch.phpt (revision f8d79582)
1--TEST--
2$this in catch
3--FILE--
4<?php
5class C {
6    function foo() {
7        try {
8            throw new Exception();
9        } catch (Exception $this) {
10        }
11        var_dump($this);
12    }
13}
14$obj = new C;
15$obj->foo();
16?>
17--EXPECTF--
18Fatal error: Cannot re-assign $this in %sthis_in_catch.php on line 6
19