Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69157 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84600 invoked from network); 16 Sep 2013 21:41:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Sep 2013 21:41:19 -0000 Authentication-Results: pb1.pair.com smtp.mail=zeev@zend.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=zeev@zend.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain zend.com from 209.85.128.169 cause and error) X-PHP-List-Original-Sender: zeev@zend.com X-Host-Fingerprint: 209.85.128.169 mail-ve0-f169.google.com Received: from [209.85.128.169] ([209.85.128.169:63775] helo=mail-ve0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7E/E4-57385-EFA77325 for ; Mon, 16 Sep 2013 17:41:19 -0400 Received: by mail-ve0-f169.google.com with SMTP id db12so3659752veb.0 for ; Mon, 16 Sep 2013 14:41:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:references:in-reply-to:mime-version :thread-index:date:message-id:subject:to:cc:content-type; bh=8+B9Cv7O+xPDNxZce+e57siCQhUQIdhbl149OLQs4a8=; b=gGD19ktDKyhkW3Il7zHIVpEXniDLC62BUIcrtEZqC57U9fKirvkCGZyuQHMMP8Jyvd EUFGViYsNtSPJz79THEwZQIEju+jcOaN5SXXDe9MGLj96mo1/hIQKohJADRAzpXDcpYF DISaRlwiYue2z4YzvbgZ6icFTHPzqr1RpKAh10uFV4unXeBWy1Mtwbb72er+VMcHE4Iy N8CdHLk2X++coyFpCqKgS83bUkuRY5UgswIFuSucup53RsKDuLEYLh34d4dpa3K9KofO aBx5NyAvElPRGU8bkwlHFKrG36lSaLxPKWUF2rmW4jReg+ve0fh5z3S4n4mE92IAzvmY yIZw== X-Gm-Message-State: ALoCoQmoTt4uFiJ6Hymsem56QDjbrj/n0N5Fd7XwYVCzfH1n3kv5GgftFC2Ei6o3Oms0EpqG/n7WBhL483A7feDvaJINS3N3ixUKcY4iis6FZIobZpdRU34TENI25ajw8f+MIJKW9MCA X-Received: by 10.52.108.230 with SMTP id hn6mr2805828vdb.28.1379367675766; Mon, 16 Sep 2013 14:41:15 -0700 (PDT) References: <521E750F.6070800@sugarcrm.com> c165f6118d8f51141f24f2766c3bd59f@mail.gmail.com In-Reply-To: c165f6118d8f51141f24f2766c3bd59f@mail.gmail.com MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQJbKA7IjQdeWQEHqGjD2+5ypdPJsgLB/Q9IAqjWn7EB55RK2ph1V2XwgAAO+iA= Date: Tue, 17 Sep 2013 00:41:10 +0300 Message-ID: <513f5c8e856cec5f71d8828d02f19e3a@mail.gmail.com> To: Nikita Popov , Stas Malyshev Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: RE: [PHP-DEV] [RFC] Syntax for variadic functions From: zeev@zend.com (Zeev Suraski) > -----Original Message----- > From: Zeev Suraski [mailto:zeev@zend.com] > Sent: Monday, September 16, 2013 11:52 PM > To: 'Nikita Popov'; 'Stas Malyshev' > Cc: 'PHP internals' > Subject: RE: [PHP-DEV] [RFC] Syntax for variadic functions > > > -----Original Message----- > > From: Nikita Popov [mailto:nikita.ppv@gmail.com] > > Sent: Thursday, August 29, 2013 3:03 PM > > To: Stas Malyshev > > Cc: PHP internals > > Subject: Re: [PHP-DEV] [RFC] Syntax for variadic functions > > > > On Thu, Aug 29, 2013 at 12:09 AM, Stas Malyshev > > wrote: > > > > > Hi! > > > > > > I like the idea, the concept of capturing "rest of args" is pretty > > > common. But couldn't we in addition have func_get_args() be able to > > > receive an int argument that would produce "the rest" in an easier > > > way for those that prefer func_ger_args()? > > > > > > > I would do that if this RFC doesn't pass, but I don't see much point > > doing both things (syntax + extra arg). Are there any particular > > scenarios where using func_get_args() would be preferable? > > Admittedly I'm (very) late to the game, but admittedly #2 - I actually just > noticed this thread as it went up for a vote. > Personally I find Stas's direction preferable to introducing new semantics - > mainly because I think that with every new piece of syntax we make the > language a tad bit more complex no matter what. > Conversely, adding an optional argument to func_get_args() sticks with the > same spirit we've had for years regarding variadic functions, and arguably is > more versatile. Assuming we implement a [, start[, end]] syntax support, > then you can more granularly split exactly the offsets you want - in case you > don't want all of them in one array (which would require a call to > array_slice() using the new syntax). Before you jump and say it's not such a > common case - I agree - I said arguably :) After thinking about it some more I see more value in the 2nd feature of this RFC - the ability to do pass by reference on variable argument lists - than I initially realized, so I'm actually in favor of the RFC. I'm still in favor of func_get_args() being updated with start/end optional parameters though. Zeev