Re: [RFC][DISCUSSION] Revisit trailing commas in function arguments
| From: | Sara Golemon | Date: | Fri, 16 Oct 2015 00:12:25 +0000 |
| Subject: | Re: [RFC][DISCUSSION] Revisit trailing commas in function arguments | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-88845@lists.php.net to get a copy of this message | ||
On Thu, Oct 15, 2015 at 1:08 PM, Nikita Popov <nikita.ppv@gmail.com> wrote:
>> I would say that it should be modified to disallow a trailing comma
>> following either a variadic declaration or a splat invocation, since
>> the grammar around these two things prohibits followups anyway.
>
>
> We allow multiple splats in one call. Something like this (after trailing
> comma patch) should be just fine:
>
> foo(
> ...$args,
> ...$moreArgs,
> ...$evenMoreArgs,
> );
>
> We don't allow multiple variadic parameters. However I also see little point
> in explicitly forbidding this one case. You'd be able to use the trailing
> comma in all cases ... apart from that one single instance.
>
Derp, right. Sorry. I don't really know PHP. Is it like Ruby?
-Sara