3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_export(call_user_func_array("array_shift", (array("Test #1")))); echo "\n"; $arg1 = array("Test #2"); var_export(call_user_func_array("array_shift", array($arg1))); echo "\n"; $args = array(array("Test #3")); var_export(call_user_func_array("array_shift", $args)); echo "\n";
based on qoPje
Output for 7.1.0 - 7.2.0
Warning: Parameter 1 to array_shift() expected to be a reference, value given in /in/golQT on line 3 Warning: array_shift() expects parameter 1 to be array, string given in /in/golQT on line 3 NULL Warning: Parameter 1 to array_shift() expected to be a reference, value given in /in/golQT on line 7 'Test #2' Warning: Parameter 1 to array_shift() expected to be a reference, value given in /in/golQT on line 11 'Test #3'
Output for 7.0.0 - 7.0.20
Warning: Parameter 1 to array_shift() expected to be a reference, value given in /in/golQT on line 3 NULL Warning: Parameter 1 to array_shift() expected to be a reference, value given in /in/golQT on line 7 NULL Warning: Parameter 1 to array_shift() expected to be a reference, value given in /in/golQT on line 11 NULL
Output for 5.3.20 - 5.6.28
Warning: array_shift() expects parameter 1 to be array, string given in /in/golQT on line 3 NULL Warning: Parameter 1 to array_shift() expected to be a reference, value given in /in/golQT on line 7 NULL Warning: Parameter 1 to array_shift() expected to be a reference, value given in /in/golQT on line 11 NULL