3v4l.org

run code in 300+ PHP versions simultaneously
<?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();
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

preferences:
48.14 ms | 406 KiB | 5 Q