3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function cExceptionHandler($exception) { $terminus = self::getInstance(); if ($exception instanceof c_Exception_Exit) { $msg = $exception->getMessage(); if ($msg) { echo $msg; } $terminus->doExit(1); } elseif ($exception instanceof c_Exception_Fatal) { $terminus->doDie($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')
Output for 5.4.0 - 5.4.25
Parse error: syntax error, unexpected end of file in /in/ZnB86 on line 30
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected $end in /in/ZnB86 on line 30
Process exited with code 255.