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)$e; }); try { // Will be caught echo array().PHP_EOL; } catch(ErrorException $e) {} // Will not be caught echo array().PHP_EOL;
based on Gafno
Output for 7.0.0 - 7.2.0
Notice: Array to string conversion in /in/OYt08 on line 16 Notice: Array to string conversion in /in/OYt08 on line 20 Array Array
Output for 5.4.2 - 5.6.28
** Uncaught Exception ** exception 'ErrorException' with message 'Array to string conversion' in /in/OYt08:20 Stack trace: #0 /in/OYt08(20): {closure}(8, 'Array to string...', '/in/OYt08', 20, Array) #1 {main}
Output for 5.3.17 - 5.3.29
Array Array