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 (string)toString(); }); try { // Will be caught echo array().PHP_EOL; } catch(ErrorException $e) {} // Will not be caught echo array().PHP_EOL;
based on 0dU3o
Output for 7.0.0 - 7.2.0
Notice: Array to string conversion in /in/Gafno on line 16 Notice: Array to string conversion in /in/Gafno on line 20 Array Array
Output for 5.4.2 - 5.6.28
** Uncaught Exception ** Fatal error: Call to undefined function toString() in /in/Gafno on line 10
Process exited with code 255.
Output for 5.3.17 - 5.3.29
Array Array