3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function my_errorhandler($errno,$errormsg) { global $my_var; $my_var = 0; echo "EROOR: $errormsg\n"; return null; } function asdf($a, $b) { var_dump("called"); } set_error_handler("my_errorhandler"); $my_var = asdf("A",$my_var[0]->errormsg = "xyz"); echo "ok\n"; ?>
based on Fa6G0
Output for 5.0.0 - 5.2.17, 5.3.7 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
EROOR: Creating default object from empty value string(6) "called" ok
Output for 5.3.0 - 5.3.6
EROOR: Creating default object from empty value
Process exited with code 139.
Output for 4.3.0 - 4.4.9
string(6) "called" ok