Combining positional and named arguments.
You can use positional and named
arguments at the same time. When you do so, the positional arguments must come first, and the named arguments after.
For example: $time = mktime(4, year: 2010);
The first argument, $hour, is passed using the first positional argument (the value "4"). The other argument, $year, is passed using the named argument "year".
This is useful if you want to skip all the
optional arguments between $hour and $year.
With positional arguments only,
you'd have to list *all* the optional arguments up to $year, like this: $time = mktime(4, NULL, NULL, NULL, NULL, 2010);
|