3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test_func_get_args() { var_dump(func_get_args()); // as expected } function test_array_slice($array) { var_dump(array_slice($array, 1)); // as expected } function test_array_slice_with_func_get_args() { var_dump(array_slice(func_get_args(), 1)); // ??? } $input = [1, 2, 3]; echo "=-=-=-= TEST func_get_args() =-=-=-=\n"; test_func_get_args(...$input); echo "\n=-=-=-= TEST array_slice() =-=-=-=\n"; test_array_slice($input); echo "\n=-=-=-= TEST 3 =-=-=-=\n"; test_array_slice_with_func_get_args(...$input);

preferences:
25.88 ms | 405 KiB | 5 Q