In following function we have some arguments with default value, How can I call that function with assigning value to some of them.
function foo($a, $b='def b', $c='def c', $d='def d'){
//....
}
//call foo for $a='nu a' and $c='nu c'
foo('nu a', $c='nu c'); //but b will be assigned
I want to set value for $c
and don't want to assign all of them just for $c
.
Not acceptable solution:
foo('nu a', 'def b', 'nu c');
Not acceptable solution
//moving c to second argument function foo($a, $c='def c', $b='def b', $d='def d'){ }
So argument is after some default arguments and I don't want to set default value for previous arguments just for one