Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68763 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14962 invoked from network); 30 Aug 2013 22:28:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Aug 2013 22:28:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=linepogl@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=linepogl@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.45 as permitted sender) X-PHP-List-Original-Sender: linepogl@gmail.com X-Host-Fingerprint: 209.85.219.45 mail-oa0-f45.google.com Received: from [209.85.219.45] ([209.85.219.45:45348] helo=mail-oa0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 55/C2-00443-58C11225 for ; Fri, 30 Aug 2013 18:28:22 -0400 Received: by mail-oa0-f45.google.com with SMTP id m1so2353623oag.32 for ; Fri, 30 Aug 2013 15:28:18 -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=mNTwgRLHSjLMBh0qYG1fEkx1sp036dNly9VZqUq234g=; b=Yi6CZm39H04DPKNTOQTKmvozWuHiXCSGhVs6NKpLNgsU/Jk4HnUyA0Et/FxaquwVTL 1ALIqt84k0pgXyszobARK1k7Nf6wsMaX6RdpymEu9HNqPXMXVU6O/2HO5C5sBekxA0C3 GgSF9zDF2Kg+nIibp7Ki339zDMJ4oq89+JFZmzHVCFtshNryM/w5Xmr/fM2bVe3iMA9p l1aEIeTTdhE01fcvvZgxk2UMMcj6hdXxRh7JJ8bl1ITVfkAwhzPgLoyULIQe4TXTEJ+I F60swkpQf8IkNhyuEJTOzMe7ZuQI1ifYto1n//yBarWyEgVN/fNJMGLLVdXWQglGXyW7 L98A== X-Received: by 10.182.129.233 with SMTP id nz9mr8685768obb.8.1377901698623; Fri, 30 Aug 2013 15:28:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.100.6 with HTTP; Fri, 30 Aug 2013 15:27:58 -0700 (PDT) In-Reply-To: <522113B1.8000605@sugarcrm.com> References: <5220CEDE.8080600@sugarcrm.com> <5220DA50.9020306@sugarcrm.com> <522113B1.8000605@sugarcrm.com> Date: Sat, 31 Aug 2013 00:27:58 +0200 Message-ID: To: Stas Malyshev Cc: Nikita Popov , PHP internals Content-Type: multipart/alternative; boundary=089e0149d28a482e6304e531bd5d Subject: Re: [PHP-DEV] [RFC] Argument unpacking From: linepogl@gmail.com (Lazare Inepologlou) --089e0149d28a482e6304e531bd5d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2013/8/30 Stas Malyshev > > don't see a reason why one should explicitly disallow doing multiple > > unpacks. > > Because it makes very hard to understand what's going on and makes no > sense semantically. > > > As you can see, here two arguments are unpacked in one call. > > This is very special use case to be hidden in library functions, I don't > think we need to have language syntax specially directed at that, at the > cost of making it overall more complex and hard to understand. I can see > what "add all those params at the end" syntax mean. However having > something like ($a, ...$b, $c, ...$d, $e, $f, $g, ...$h) I have no idea > what's going on at all and what is sent where. > > I agree with Stas here. If an argument comes after an unpacked array, its position is not certain until runtime. This makes life difficult for static analysis tools, which is one of the reasons for introducing the new syntax. Even in the use case of Nikita, the two arguments to be unpacked come without any standard arguments between or after them. I suggest that argument unpacking should be limited to the last arguments only. 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 > > --089e0149d28a482e6304e531bd5d--