Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4922 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59967 invoked by uid 1010); 22 Oct 2003 22:02:04 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 59933 invoked from network); 22 Oct 2003 22:02:02 -0000 Received: from unknown (HELO mail.zend.com) (192.117.235.230) by pb1.pair.com with SMTP; 22 Oct 2003 22:02:02 -0000 Received: (qmail 3687 invoked from network); 22 Oct 2003 22:01:56 -0000 Received: from guardian.zend.office (HELO andi-laptop.zend.com) (10.1.1.4) by int.zend.com with SMTP; 22 Oct 2003 22:01:56 -0000 Message-ID: <5.1.0.14.2.20031022235815.0303d5f8@127.0.0.1> X-Sender: andi@127.0.0.1 X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Wed, 22 Oct 2003 23:59:59 +0200 To: Christian Schneider ,internals@lists.php.net In-Reply-To: <3F96F754.1090800@cschneid.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: [PHP-DEV] Proposal: Dangling comma in function call parameters From: andi@zend.com (Andi Gutmans) References: <3F96F754.1090800@cschneid.com> At 11:32 PM 10/22/2003 +0200, Christian Schneider wrote: >Hello everybody, >just joined the internals list (after being absent from php developers >lists for a while) so excuse my ignorance if any topic I bring up has been >discussed already. I checked the archives but couldn't find anything... > >Proposal: Allow dangling commas in function call parameters. >Reasoning: We use some handy vararg tool functions and it's nice to be >able to write >foo( > 1, > 2, > 3, >); >since it's then easy to add a new parameter without having to add a comma >to the previous list. > >This would be symmetrical to the array() syntax. The patch for zend (php4 >from cvs) would be minimal and I can't see any backwards-compatibility >issues right now (patch attached). > >Any opinions? The only reason array() supports this is because there are some cases where people auto-generate initialization files which have a huge array() construct and it makes it slightly easier (don't have the last element problem). In this case I don't see the same advantage and I see a disadvantage in readability and the possibility for PHP to give such an empty argument a meaning in future (although I doubt that'll happen). So -1 from me. Andi