3v4l.org

run code in 300+ PHP versions simultaneously
<?php function cExceptionHandler($exception) { if ($exception instanceof c_Exception_Exit) { $msg = $exception->getMessage(); if ($msg) { echo $msg; } exit(); } elseif ($exception instanceof c_Exception_Fatal) { die($exception->getMessage()); } restore_exception_handler(); if (version_compare(PHP_VERSION, '5.3.0', '>=')) { $class = get_class($exception); throw new $class($exception->getMessage(), $exception->getCode(), $exception); } throw $exception; } set_exception_handler('cExceptionHandler'); throw new Exception('test');

preferences:
45.36 ms | 402 KiB | 5 Q