Re: [RFC] Syntax for variadic functions
| From: | Matthew Leverton | Date: | Wed, 28 Aug 2013 19:27:53 +0000 |
| Subject: | Re: [RFC] Syntax for variadic functions | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-68644@lists.php.net to get a copy of this message | ||
On Wed, Aug 28, 2013 at 10:47 AM, Nikita Popov <nikita.ppv@gmail.com> wrote:
> Hi internals!
>
> I'd like to propose an RFC, which adds dedicated syntax for variadic
> functions:
> ...
>
> What are your thoughts on this?
>
I think it's great way to clean things up and add some subtle new
functionality, particularly with Lazare's follow-up proposal about
expanding an indexed array into arguments.
Would any functions get deprecated as a result of this? e.g., func_get_args()
I assume it's a syntax error to do function fn(...$foo, $bar) or
function fn(...$foo, ...$bar)
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.
--
Matthew Leverton