xref: /PHP-8.2/Zend/tests/bug68370.phpt (revision 7aacc705)
1--TEST--
2Bug #68370 "unset($this)" can make the program crash
3--FILE--
4<?php
5class C {
6    public function test() {
7        unset($this);
8        return get_defined_vars();
9    }
10}
11$c = new C();
12$x = $c->test();
13print_r($x);
14unset($c, $x);
15?>
16--EXPECTF--
17Fatal error: Cannot unset $this in %sbug68370.php on line 4
18