I posted here before about "this" being in get_defined_vars.
It turns out it's not always there but in certain cases it will inexplicably appear.
php -r '
class Test {
public function a() {var_dump(array_keys(get_defined_vars()));$a = 123;}
public function b() {var_dump(array_keys(get_defined_vars()));$this;}
}
$t = new Test();
$t->a();
$t->b();
'
array()
array('this')
This does not happen in PHP 7.2 but will happen in PHP 5.6.