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"; } set_error_handler("my_errorhandler"); $my_var = str_repeat("A",$my_var[0]->errormsg = "xyz"); echo "ok\n"; ?>
Output for 5.0.0 - 5.2.17, 5.3.7 - 5.6.28, 7.0.0 - 7.1.0
EROOR: Creating default object from empty value ok
Output for hhvm-3.10.0 - 3.12.0
EROOR: Creating default object from empty value EROOR: str_repeat() expects parameter 2 to be integer, string given 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
ok