3v4l.org

run code in 300+ PHP versions simultaneously
<?php function handler($errno, $errstr) { var_dump($errno); return false; } if (version_compare(PHP_VERSION, '5.0.0', '<')) { set_error_handler('handler'); } else { set_error_handler('handler', ~0); } function test($string) { $string = 'bar'; } $a = 'foo'; test(&$a); echo $a; eval($val.'(&$a);'); function_exists('error_get_last') && var_dump(error_get_last());
Output for 5.4.0 - 5.4.15
Fatal error: Call-time pass-by-reference has been removed; If you would like to pass argument by reference, modify the declaration of test(). in VbRVK on line 18
Process exited with code 255.
Output for 5.3.25
Deprecated: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of test(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /in/JtnWu on line 18 barint(8) Notice: Undefined variable: val in /in/JtnWu on line 20 Parse error: syntax error, unexpected '&' in /in/JtnWu(20) : eval()'d code on line 1 array(4) { ["type"]=> int(4) ["message"]=> string(28) "syntax error, unexpected '&'" ["file"]=> string(29) "/in/JtnWu(20) : eval()'d code" ["line"]=> int(1) }
Process exited with code 255.
Output for 5.3.0 - 5.3.24
Deprecated: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of test(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in VbRVK on line 18 barint(8) Notice: Undefined variable: val in VbRVK on line 20 Parse error: syntax error, unexpected '&' in VbRVK(20) : eval()'d code on line 1 array(4) { ["type"]=> int(4) ["message"]=> string(28) "syntax error, unexpected '&'" ["file"]=> string(29) "VbRVK(20) : eval()'d code" ["line"]=> int(1) }
Process exited with code 255.

preferences:
186.38 ms | 1395 KiB | 49 Q