3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_error_handler('myerrorhandler'); set_exception_handler('myexceptionhandler'); function myfunc(stdClass $a) {} function myerrorhandler($errno, $errstr, $errfile, $errline, $errcontext) { echo "Error handler\n$errno\n$errstr\n"; } function myexceptionhandler($e) { echo "Exception handler\n";var_dump($e); } try { myfunc('iamnotaclass'); } catch (Exception $e) { echo "Exception\n"; throw $e; } catch (Throwable $e) { echo "Throwable\n"; throw $e; }

preferences:
47.07 ms | 402 KiB | 5 Q