3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_error_handler(function($num, $msg, $file, $line) { throw new ErrorException($msg, 0, $num, $file, $line); }); set_exception_handler(function($e) { echo '** Uncaught Exception **'.PHP_EOL; echo (string)toString(); }); try { // Will be caught echo array().PHP_EOL; } catch(ErrorException $e) {} // Will not be caught echo array().PHP_EOL;

preferences:
46.89 ms | 402 KiB | 5 Q