Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105102 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 70935 invoked from network); 5 Apr 2019 12:09:02 -0000 Received: from unknown (HELO smtpbgsg2.qq.com) (54.254.200.128) by pb1.pair.com with SMTP; 5 Apr 2019 12:09:02 -0000 X-QQ-mid:Yeas17t1554455081t874t19257 Received: from 90373548D78A4F9A84016F99F658592A (me@jhdxr.com [155.69.203.163]) X-QQ-SSF:00000000000000F0F61000000000000 To: "'Claude Pache'" , "'Stijn Peeters'" Cc: "'PHP internals'" References: <003a01d4eaf0$c17d6c20$44784460$@jhdxr.com> <07B1B207-1FCE-412F-837A-6956DCCA1F51@gmail.com> In-Reply-To: <07B1B207-1FCE-412F-837A-6956DCCA1F51@gmail.com> Date: Fri, 5 Apr 2019 17:04:38 +0800 Message-ID: <00c801d4eb8e$9922b8e0$cb682aa0$@jhdxr.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Content-Language: en-us Thread-Index: AQIKWL9sdr8zqvFBmN46rJnDR+4gNwIpnp9yAIefNKOlrN6FEA== X-QQ-SENDSIZE: 520 Feedback-ID: Yeas:jhdxr.com:qybgforeign:qybgforeign2 X-QQ-Bgrelay: 1 Subject: RE: [PHP-DEV] [RFC] Spread Operator in Array Expression v0.2 From: me@jhdxr.com (=?utf-8?b?Q0hVIFpoYW93ZWk=?=) The [original argument unpacking = RFC](https://wiki.php.net/rfc/argument_unpacking?rev=3D1389442371) does = allow positional arguments after unpacking, but later it's changed due = to some implement issue, see = https://github.com/php/php-src/commit/d3b484df8268f7ab31c4ac39734d4b68ce2= e6159 I didn't see the same limit exists for arrays, so I didn't include this = rule in my RFC.=20 Thanks, CHU Zhaowei -----Original Message----- From: Claude Pache =20 Sent: Friday, April 5, 2019 4:04 PM To: Stijn Peeters Cc: CHU Zhaowei ; PHP internals Subject: Re: [PHP-DEV] [RFC] Spread Operator in Array Expression v0.2 > Le 5 avr. 2019 =C3=A0 09:45, Stijn Peeters a = =C3=A9crit : >=20 > Hi, >=20 > If I understand correctly it is possible in this proposal to use = normal arguments after using an unpackable argument: >=20 > $arr4 =3D array(...$arr1, ...$arr2, 111); //valid >=20 > This is something that is not possible when using argument unpacking = in function calls: >=20 > $result =3D someFunction(...$arr1, ...$arr2, 111); //invalid >=20 > While I personally like the more permissive variety in this RFC, I = think this could be a confusing inconsistency, and for clarity's sake it = would be better to keep both instances of the unpacking syntax as = consistent with each other as possible. >=20 > Best, > Stijn=20 >=20 >=20 That begs the question: why is this invalid for function calls? In fact, I am able to easily hack around the limitation: $result =3D someFunction(...$arr1, ...$arr2, ...[111]); // valid but the limitation seems just an unnecessary annoyance. =E2=80=94Claude