Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68742 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66389 invoked from network); 30 Aug 2013 17:21:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Aug 2013 17:21:32 -0000 Authentication-Results: pb1.pair.com header.from=linepogl@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=linepogl@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.171 as permitted sender) X-PHP-List-Original-Sender: linepogl@gmail.com X-Host-Fingerprint: 209.85.214.171 mail-ob0-f171.google.com Received: from [209.85.214.171] ([209.85.214.171:53078] helo=mail-ob0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C7/37-32511-B94D0225 for ; Fri, 30 Aug 2013 13:21:32 -0400 Received: by mail-ob0-f171.google.com with SMTP id tb18so2146307obb.2 for ; Fri, 30 Aug 2013 10:21:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=Ecyb+pJJKUIXTUsFDlqs6yoBjQvJzDsWe4Uqk0VeX0w=; b=igapxHmYPbY21N78rI2PI5ud2JFHmLSWI4gAOqwVTxw+MmZ25LXLV1v9GZ4xA+Pxyr YlGzyaqagr3xSvxsWoU10PLlrl6Dt+0EFE7bcauVfE2MueGtofWGD6/iXBiBOs5yQ2ve /uVJCOjdQ4J+rWPl/vZ9Pzd2GGra4KqRmxc66OHL2WJSoT4syIHzPgDAqkKjuKTDskvW r0kQ/cvgcTYWYMIh0vQcf7Wu8g+nqURSpY7EeI4k1Q4pTgwnwoDJ6BQMnzU1Vh3ir/g7 eFb8Qbc9i8P0x4JJVeBin/hkecd8u0F+pex2Lut6NgHDVuBAWWsAG9T+PI0N9xyY9Y8T scOA== X-Received: by 10.182.243.138 with SMTP id wy10mr7626988obc.83.1377883289256; Fri, 30 Aug 2013 10:21:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.100.6 with HTTP; Fri, 30 Aug 2013 10:21:09 -0700 (PDT) In-Reply-To: <5220CEDE.8080600@sugarcrm.com> References: <5220CEDE.8080600@sugarcrm.com> Date: Fri, 30 Aug 2013 19:21:09 +0200 Message-ID: To: Stas Malyshev Cc: Nikita Popov , PHP internals Content-Type: multipart/alternative; boundary=001a11c2a120ff8d2c04e52d736a Subject: Re: [PHP-DEV] [RFC] Argument unpacking From: linepogl@gmail.com (Lazare Inepologlou) --001a11c2a120ff8d2c04e52d736a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2013/8/30 Stas Malyshev > Hi! > > > This RFC proposes to add a syntax for argument unpacking: > > > > https://wiki.php.net/rfc/argument_unpacking > > > > Basically, this is the "complement" of the variadics RFC: It is not abo= ut > > declaring variadic functions, but about calling them. > > This is just another way of doing call_user_func, I'm not sure we really > need it. And something like: > test(1, 2, ...[3, 4], 5, 6, ...[7, 8]) > > looks plain weird. What would be the use case for doing something like > that? I don't think we should add this. > > Yes, this example is weird, because every argument is hardcoded anyway. I guess it has been added just for completeness. A good example would be function forwarding for variadic functions, without resorting to call_user_func_array. An even better example is that there would be no need to have both call_user_func and call_user_func_array in the first place: The former would be enough. The same applies to userland functions, and I have been many times in a situation where I had to define two different functions to cover both cases. Lazare INEPOLOGLOU Ing=C3=A9nieur Logiciel > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --001a11c2a120ff8d2c04e52d736a--