3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { function run() { $file = __FILE__ . '.tmp'; register_shutdown_function(function () use ($file) { @unlink($file); }); file_put_contents($file, '<?php self::foo(); ?>'); require $file; } static function foo() { echo 'Hi!', PHP_EOL; } } (new Test)->run();

preferences:
28.65 ms | 402 KiB | 5 Q