3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* final public ExceptionException::getPrevious ( void ) final public stringException::getFile ( void ) final private voidException::__clone ( void ) */ error_reporting(E_ALL); function exception_error_handler($errno, $errstr, $errfile, $errline ) { throw new ErrorException($errstr, '00007600', $errno, $errfile, $errline); } set_error_handler("exception_error_handler"); try { echo $x; } catch(Exception $e) { echo $e->getTraceAsString(); echo PHP_EOL . '-----------------------' . PHP_EOL; echo $e->__toString(); }

preferences:
51.24 ms | 402 KiB | 5 Q