3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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 $e->toString(); }); try { // Will be caught echo array(); } catch(ErrorException $e) {} // Will not be caught echo array();
Output for 7.0.0 - 7.2.0
ArrayArray** Uncaught Exception ** Fatal error: Uncaught Error: Call to undefined method ErrorException::toString() in /in/0dU3o:10 Stack trace: #0 [internal function]: {closure}(Object(ErrorException)) #1 {main} thrown in /in/0dU3o on line 10
Process exited with code 255.
Output for 5.4.2 - 5.6.28
ArrayArray** Uncaught Exception ** Fatal error: Call to undefined method ErrorException::toString() in /in/0dU3o on line 10
Process exited with code 255.
Output for 5.3.17 - 5.3.29
ArrayArray