xref: /PHP-7.4/Zend/tests/bug68370.phpt (revision a9512af8)
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--EXPECTF--
16Fatal error: Cannot unset $this in %sbug68370.php on line 4
17