Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:39182 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96966 invoked from network); 22 Jul 2008 12:52:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jul 2008 12:52:45 -0000 X-Host-Fingerprint: 200.150.147.21 unknown Received: from [200.150.147.21] ([200.150.147.21:23260] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CC/99-46193-A18D5884 for ; Tue, 22 Jul 2008 08:52:44 -0400 Message-ID: To: internals@lists.php.net Date: Tue, 22 Jul 2008 09:55:36 -0300 User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 References: <894DE025-CBC7-4BFA-8FAA-D0215B194F94@facebook.com> In-Reply-To: <894DE025-CBC7-4BFA-8FAA-D0215B194F94@facebook.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 200.150.147.21 Subject: Re: Modify language grammar to allow trailing commas in function/method calls From: rodrigo.saboya@bolsademulher.com (Rodrigo Saboya) Evan Priestley escreveu: > This was floated in 2003 but had weak advocation and didn't seem to come > to a decisive resolution: > > http://marc.info/?l=php-internals&m=106685833011253&w=2 > > Basically, the proposal is to modify the grammar to allow trailing > commas in function and method calls, so this becomes a parseable PHP > construct: > > f(1, 2, 3,); > > This patch applies only to function and method calls; it does not apply > to function or method definitions. It also does not allow the > degenerative case of "f(,)". > > The real value of relaxing this rule is in nontrivial cases that span > across multiple lines: > > sprintf( > 'long example pattern with %d conversions: %s', > $several, > $conversions > ); > You could just do this: sprintf( 'long example pattern with %d conversions: %s' ,$several ,$conversions ); I really don't see a great benefit here, and as you pointed out it would make code written with trailing commas incompatible with previous versions of PHP. -- Rodrigo Saboya