3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $success=false; if (true) { set_error_handler(function($a, $b, $c, $d) { var_dump('error_handler', $a, $b, $c, $d); }); register_shutdown_function(function(){ if ($GLOBALS['success']){return;} var_dump('shutdown_function', error_get_last()); }); } $var = 1; try { // $var->method(); // Throws an Error object in PHP 7. $buf.='nyanpasu'; } catch (Error $e) { // Handle error var_dump('error', $e); } catch (Exception $e) { // Handle error var_dump('exception', $e); } $success=true; ?>
based on 5GXkP
Output for 5.3.20 - 7.2.0
string(13) "error_handler" int(8) string(23) "Undefined variable: buf" string(9) "/in/gSBnb" int(18)