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; } set_error_handler("my_errorhandler"); var_dump($my_var[0]->errormsg = "xyz"); $my_var = str_repeat("A",$my_var[0]->errormsg = "xyz"); ?>
based on J0r0Z
Output for 5.3.7 - 7.1.0
EROOR: Creating default object from empty value NULL EROOR: Cannot use a scalar value as an array
Output for 5.3.0 - 5.3.6
EROOR: Creating default object from empty value
Process exited with code 139.
Output for 5.1.3 - 5.1.6, 5.2.4 - 5.2.17
EROOR: Creating default object from empty value string(3) "xyz" EROOR: Cannot use a scalar value as an array
Output for 5.2.0 - 5.2.3
EROOR: Creating default object from empty value string(3) "xyz"
Process exited with code 139.
Output for 5.0.0 - 5.1.2
EROOR: Creating default object from empty value string(3) "xyz" EROOR: Cannot use a scalar value as an array EROOR: Creating default object from empty value
Output for 4.3.0 - 4.4.9
string(3) "xyz"