Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:66053 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91164 invoked from network); 20 Feb 2013 11:05:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Feb 2013 11:05:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.210.179 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.210.179 mail-ia0-f179.google.com Received: from [209.85.210.179] ([209.85.210.179:47335] helo=mail-ia0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AB/ED-19387-21EA4215 for ; Wed, 20 Feb 2013 06:05:55 -0500 Received: by mail-ia0-f179.google.com with SMTP id x24so6994010iak.24 for ; Wed, 20 Feb 2013 03:05:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:sender:x-originating-ip:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:x-gm-message-state; bh=3A7sM2Td2Di5WZZG55Vpm6ue2P2Lo78oAfLd7fEaD0o=; b=m+ai2/1Z13h/FNitTTahd4HjvsjV2se37JwrML1skU5Y3+4V+Z++JEG9jmaSYpIBqh XPPEPvDxE9Y94ww9A6iKzhTH9x0G6qfnavPAqu40/k6qyUV2Jw6qXIQI/ISa3LNdCYee +5nvUgGJV95iLr61uz4RES79wcWoaxxK8W8g4CVNwkKpKkb5nNuOYIOpzeHNFlnbO6xk 7mSW3tm9I890XHV5hSAB1IuvwwYYF0TH8NJzWorkMbzsxqD9ucZ7FapzRG+FnQM4e89y toinPmG/revPR0HdAbbKToukOnpgptU2vkVvCXk0m0SksOw8yQ2+A4g1bM+aH3qF+C97 IBFQ== MIME-Version: 1.0 X-Received: by 10.50.37.162 with SMTP id z2mr10191250igj.13.1361358352811; Wed, 20 Feb 2013 03:05:52 -0800 (PST) Sender: php@golemon.com Received: by 10.64.139.100 with HTTP; Wed, 20 Feb 2013 03:05:52 -0800 (PST) X-Originating-IP: [2001:470:1f09:2fa:3026:5ca2:41f3:8512] In-Reply-To: References: Date: Wed, 20 Feb 2013 03:05:52 -0800 X-Google-Sender-Auth: bs4a8S5-YySoqXJ62GtwIviRmnc Message-ID: To: Florin Razvan Patan Cc: PHP internals Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQnHYwdAhovtQLcnxfLr0qPyLEwdNmrr2MsiNe0NJ2YOpYN2QcHJay6zbzwFx4LmfiGPpLi0 Subject: Re: [PHP-DEV] [RFC] Allow trailing comma in function call argument lists From: pollita@php.net (Sara Golemon) On Wed, Feb 20, 2013 at 12:47 AM, Florin Razvan Patan wrote: > For example, I would expect that if I have: > > function A($b, $c = 'd') {} > > when I see A($b, ) to have no syntax errors but rather $c defaulted to > the value in the function signature, which is not implied nor assumed > by the RFC but it would be by the one reading a function. > Your assumption would be correct. Since the trailing comma is ignored, the function call happens with only one argument and the second is left as the default. > Then when I have > > function A($b, $c = 'd', $e) {} > > to be able to have A($b, , $e) which again this RFC doesn't specify > that it allows but leads to confusion. > That function signature is invalid, so you'd never have code like that running anyway. The call is also invalid and again you wouldn't have code like that because it would never run. Thee RFC doesn't explicitly specify either of these points, but they are implied by the patch provided which only allows for a tailing comma at the end, not "bonus commas" in the middle or at the beginning. > As for the argument about the VCS, I really don't see an issue with > the current way of thing. Some people don't use the comma at the > end of the arrays and it doesn't mean that they all should. > Of course not, but as you stated it would help consistency if they could. -Sara