3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php set_error_handler(function($num, $msg, $file, $line) { // Convert to exceptions throw new ErrorException($msg, 0, $num, $file, $line); }); set_exception_handler(function($e) { // Print or log to file echo get_class($e).': '.$e->getMessage().' ['.$e->getFile().':'.$e->getLine().']'; }); try { // Will be caught echo array(); } catch(ErrorException $e) {} // Will not be caught echo array();
Output for 5.4.7 - 7.1.7
ArrayArrayErrorException: Array to string conversion [/in/c637v:22]
Output for 5.3.17 - 5.3.29
ArrayArray