- var_dump: documentation ( source)
- array_slice: documentation ( source)
<?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);