<?php
function foo($a, $b) {
echo "In foo; a is $a and b is $b\n";
}
function bar($args) {
echo "In bar; args is ", var_export($args, true), "\n";
foo(...$args);
}
function baz(...$args) {
echo "In baz; args is ", var_export($args, true), "\n";
foo(...$args);
}
bar(['b'=> 'bee', 'a' => 'wahey']);
baz(b: 'bee', a: 'wahey');
In bar; args is array (
'b' => 'bee',
'a' => 'wahey',
)
In foo; a is wahey and b is bee
In baz; args is array (
'b' => 'bee',
'a' => 'wahey',
)
In foo; a is wahey and b is bee
Output for 7.4.0 - 7.4.33
Parse error: syntax error, unexpected ':', expecting ')' in /in/fvLVE on line 18
Process exited with code 255.