Re: [RFC] [Discussion] Allow a trailing comma in function calls

From: Date: Fri, 27 Oct 2017 13:46:47 +0000
Subject: Re: [RFC] [Discussion] Allow a trailing comma in function calls
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-100966@lists.php.net to get a copy of this message
On Fri, Oct 27, 2017 at 7:17 AM, Peter Cowburn <petercowburn@gmail.com> wrote: > On 24 October 2017 at 17:14, Sara Golemon <pollita@php.net> wrote: >> I'd guess because those are the only constructs which appear >> function-like *and* exhibit variadic behavior. >> >> empty/die/exit/print/require/include/require_once/include_once/__HALT_COMPILER >> don't have a variadic mode so allowing trailing commas in them would >> be pointless. > > That's a fair point, then maybe we should consider declare() too? > Perhaps, but since we've already entered voting, it'll have to be a separate RFC at this point. That, or we reset and I don't think it's worthwhile for declare because it's only got three possible values, all of which can easily fit a single line. > Also, I > know that "echo" is a "doesn't even look like a function" but can that > be > considered as if we're changing any language constructs at all in this RFC, > then that might benefit too. Note, I'm just saying "consider" on purpose, > rather than suggesting any change to the RFC actually be made. > At a shot-from-the-hip guess, I'd assume that would introduce parser ambiguity because of the lack of delimiting parenthesis. -Sara

« previous php.internals (#100966) next »