- Output for 8.1.0 - 8.1.29, 8.2.0 - 8.2.23, 8.3.0 - 8.3.11
- array(0) { } bool(false) NULL
<?php
final class MyTerribleCode
{
public function demo(): void
{
$a = 1;
(static function () {
eval(
<<<'PHP'
var_dump(get_defined_vars());
var_dump(isset($this));
try {
var_dump(self::class);
} catch (Error) {
var_dump(null);
}
PHP
);
})->bindTo(null, null)();
}
}
(new MyTerribleCode())->demo();