Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68740 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63425 invoked from network); 30 Aug 2013 17:14:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Aug 2013 17:14:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.173 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.128.173 mail-ve0-f173.google.com Received: from [209.85.128.173] ([209.85.128.173:49835] helo=mail-ve0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 34/86-32511-103D0225 for ; Fri, 30 Aug 2013 13:14:41 -0400 Received: by mail-ve0-f173.google.com with SMTP id cy12so1574148veb.32 for ; Fri, 30 Aug 2013 10:14:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=NLYfBH/8HiETAX4NJ4vkuzebO4ipq1qZbIy7JEopD3w=; b=MJ720Fr5zuNEVJgqvmof/lVOzMD8R8CXwqGKNMi/QUghhg/04qB+1rmL8+N0s/N1tz j1pdmVC7Ad6yRaV1yZs/IoQxVlqXcCJZeP7TdhyNu5cCG21JaMibRH7WS5DRFR3zhXWX 0fPyO5Sxko4lVDygmF72s7QCGJigcW0a+h2PDWnOexNy5rfgASnlAp7ZSjqjKoq1EK32 ZdITPXHJ3lmmzGgWRoJQ11zV42rrcCaS0rHgSC5aFq2f9MayfzHF4sArChnuVGB8dtPm yHZTgmiazGzt1hCeupEqut61HiOObfmtnk2NUscGVBpDp7MshMLh4q0d/8HoJx8QKYYC Etrw== MIME-Version: 1.0 X-Received: by 10.58.54.70 with SMTP id h6mr4499vep.36.1377882400067; Fri, 30 Aug 2013 10:06:40 -0700 (PDT) Received: by 10.220.17.136 with HTTP; Fri, 30 Aug 2013 10:06:40 -0700 (PDT) In-Reply-To: <5220CEDE.8080600@sugarcrm.com> References: <5220CEDE.8080600@sugarcrm.com> Date: Fri, 30 Aug 2013 19:06:40 +0200 Message-ID: To: Stas Malyshev Cc: PHP internals Content-Type: multipart/alternative; boundary=089e0122ad06ff9cb704e52d3e2e Subject: Re: [PHP-DEV] [RFC] Argument unpacking From: nikita.ppv@gmail.com (Nikita Popov) --089e0122ad06ff9cb704e52d3e2e Content-Type: text/plain; charset=ISO-8859-1 On Fri, Aug 30, 2013 at 6:57 PM, Stas Malyshev wrote: > 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? No use case at all. This is a technical specification, so I write down what is possible, not necessarily what you'd write in your code. Of course it makes no sense to write something like ...[1, 2, 3], because you could just as well write 1, 2, 3 directly. The point of that example is that it's possible to mix it with normal arguments. The "practical" example for that is the example in the introduction: $db->query($query, ...$params). Here a "normal" argument is followed by an unpacked argument. > This is just another way of doing call_user_func, I'm not sure we really need it. Assuming you mean call_user_func_array, yes. This is just syntax sugar for call_user_func_array. Advantages of this syntax over cufa are outlined here: https://wiki.php.net/rfc/argument_unpacking#advantages_over_call_user_func_array Thanks, Nikita --089e0122ad06ff9cb704e52d3e2e--