3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = "test!"; $b = "test B!"; function errhnd($a=$GLOBALS['a'], $b=$GLOBALS['b'], $errno, $errstr, $errfile, $errline) { # need $a and $b vars here! echo $a; echo "\n"; echo $b; echo "\n"; echo $errno; echo "\n"; echo $errstr; echo "\n"; echo $errfile; } set_error_handler('errhnd'); fuidaa;
Output for 5.4.0 - 5.4.24
Parse error: syntax error, unexpected '$GLOBALS' (T_VARIABLE) in /in/Yi7Qh on line 6
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE in /in/Yi7Qh on line 6
Process exited with code 255.

preferences:
183.51 ms | 1394 KiB | 61 Q