Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:69292 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98689 invoked from network); 23 Sep 2013 19:33:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Sep 2013 19:33:11 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.176 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.214.176 mail-ob0-f176.google.com Received: from [209.85.214.176] ([209.85.214.176:60239] helo=mail-ob0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3C/B1-25349-67790425 for ; Mon, 23 Sep 2013 15:33:10 -0400 Received: by mail-ob0-f176.google.com with SMTP id uy5so3809985obc.21 for ; Mon, 23 Sep 2013 12:33:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=6qrJeY749U5S4XPJjnbZdlLAysEXcK+JlpBZACzSvq4=; b=WOj6QJ6W2vDicfSsXnR9742HVAzM1W/5EE2ShFN0dwqo15dxcnIft1Ry7AYSVz+9cX wY1LFDl5OMMj0ThePXPMbJY4xUz3ekQq7no4/0owvmU6O1jq6H5F56GrHEahr1dRkB+1 HZy150tfW4xDKr9azWqpwFw9DT2HPaj/cecGxPfnXTwrnYFL9CJkkHRbKqxJ66gIw5An OAHdZonlj85k0GxEhxddGmKI+Uvj9M4PENoaSWIiiQSG1F065cpkpCJ2H6ozuhHBgDNg TLS35z67v1ny2YxxO1xmlTbMRwjCDqUyfHmfOoYmroB3o9JZ6JPFtVFaJBROGKFhS3Vu lLlQ== MIME-Version: 1.0 X-Received: by 10.60.144.230 with SMTP id sp6mr879434oeb.102.1379964787222; Mon, 23 Sep 2013 12:33:07 -0700 (PDT) Received: by 10.182.98.8 with HTTP; Mon, 23 Sep 2013 12:33:07 -0700 (PDT) Date: Mon, 23 Sep 2013 21:33:07 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary=047d7b5d5c14f1efd304e712162a Subject: Argument unpacking - Multiple unpacks and trailing arguments From: nikita.ppv@gmail.com (Nikita Popov) --047d7b5d5c14f1efd304e712162a Content-Type: text/plain; charset=ISO-8859-1 Hi internals! I'd like to finish up the argument unpacking proposal ( https://wiki.php.net/rfc/argument_unpacking). The main open question (or at least the focus of the discussion) seems to be whether to allow multiple unpacks and trailing arguments. An example of multiple unpacks is the bind() function: function bind(callable $function, ...$boundArgs) { return function(...$args) use($function, $boundArgs) { return $function(...$boundArgs, ...$args); } } This example is detailed a bit more in the RFC: https://wiki.php.net/rfc/argument_unpacking#partial_applicationmultiple_unpacks An example of trailing arguments are array intersections and diffs using a custom compare function: array_uintersect(...$arrays, $compare); array_udiff(...$arrays, $compare); // also array_intersect_uassoc and all those other variations on the topic Some people expressed concern about allow both usages (multiple unpacks / trailing args). I have a bit of a hard time understanding this (as there clearly are practical applications for both), so I'd appreciate some more opinions on the topic. Thanks, Nikita --047d7b5d5c14f1efd304e712162a--