Re: [RFC] Syntax for variadic functions

From: 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 [email protected] to get a copy of this message
On Wed, Aug 28, 2013 at 9:27 PM, Matthew Leverton <[email protected]>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


Thread (24 messages)

« previous php.internals (#68649) next »