3v4l.org

run code in 300+ PHP versions simultaneously
<?php function handler($errno, $errstr, $errfile, $errline){ echo "Handler in action: \n"; var_export($errstr); return true; } set_error_handler("handler"); $input = "Fly again"; function test(string $test) : string { return $test; } try{ echo test($input); } catch(Exception $ex) { echo "Catched Exception: \n"; var_export($ex); } catch(Error $er) { echo "Catched Error: \n"; var_export($er); }

preferences:
27.78 ms | 402 KiB | 5 Q