Re: [RFC] Syntax for variadic functions
| From: | Nikita Popov | Date: | Wed, 28 Aug 2013 20:15:56 +0000 |
| Subject: | Re: [RFC] Syntax for variadic functions | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-68649@lists.php.net to get a copy of this message | ||
On Wed, Aug 28, 2013 at 9:27 PM, Matthew Leverton <leverton@gmail.com>wrote:
> Would any functions get deprecated as a result of this? e.g.,
> func_get_args()
>
Nope, func_get_args() etc stay. This is now mentioned in
https://wiki.php.net/rfc/variadics#userland.
> I assume it's a syntax error to do function fn(...$foo, $bar) or
> function fn(...$foo, ...$bar)
>
Correct. This is now mentioned in
https://wiki.php.net/rfc/variadics#syntactic_restrictions.
> I assume that function fn($a, $b = null, ...$c) is possible, and the
> only way to populate $c is to call fn with three or more parameters.
>
That's also correct :)
Nikita