If I do this:
function myfunc(mixed ...$var) {
dump($var);
}
$param = [
'one' => 1,
'two' => 2,
];
myfunc(...$param);
Then the output is:
^ array:2 [
"one" => 1
"two" => 2
]
It’s useful that the array keys are preserved, but I don’t see anything about this in the documentation at https://www.php.net/manual/en/functions.arguments.php.
What’s happening here? Is it documented behaviour that’s by design, or a quirk that could vanish in a future version of PHP?