3v4l.org

run code in 300+ PHP versions simultaneously
<?php function errorHandler($errno, $errstr, $errfile, $errline) { throw new Exception($errstr); } function exceptionHandler($e) { echo "exceptionHandler: '", $e->getMessage(), "'\n"; } set_error_handler("errorHandler"); set_exception_handler("exceptionHandler"); // this works as expected //$a = $foo; // this does not $a = $foo();

preferences:
49.34 ms | 402 KiB | 5 Q