3v4l.org

run code in 300+ PHP versions simultaneously
<?php function exception_error_handler($severity, $message, $file, $line) { if (!(error_reporting() & $severity)) { return; } throw new ErrorException($message, 0, $severity, $file, $line); } set_error_handler("exception_error_handler"); try { @unlink('/var/does/not/exist'); echo '\ErrorException not thrown'; } catch (ErrorException $e) { echo '\ErrorException thrown'; }

preferences:
48 ms | 402 KiB | 5 Q