Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105176 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 55110 invoked from network); 9 Apr 2019 17:12:44 -0000 Received: from unknown (HELO smtp.opensides.be) (195.154.20.141) by pb1.pair.com with SMTP; 9 Apr 2019 17:12:44 -0000 Received: from localhost (localhost [127.0.0.1]) by smtp.opensides.be (Postfix) with ESMTP id 6AAFD224973 for ; Tue, 9 Apr 2019 16:09:38 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at opensides.be Received: from smtp.opensides.be ([127.0.0.1]) by localhost (smtp.opensides.be [127.0.0.1]) (amavisd-new, port 10024) with LMTP id fwrysBeo0LjY for ; Tue, 9 Apr 2019 16:09:35 +0200 (CEST) Received: from mcmic-probook.opensides.be (63.120.199.77.rev.sfr.net [77.199.120.63]) by smtp.opensides.be (Postfix) with ESMTPSA id D28E222496E for ; Tue, 9 Apr 2019 16:09:35 +0200 (CEST) To: internals@lists.php.net Date: Tue, 09 Apr 2019 16:09:34 +0200 Message-ID: <4444823.ddIgcOCT9J@mcmic-probook> Organization: OpenSides User-Agent: KMail/5.2.3 (Linux/4.9.0-8-amd64; KDE/5.28.0; x86_64; ; ) In-Reply-To: References: <003a01d4eaf0$c17d6c20$44784460$@jhdxr.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] Spread Operator in Array Expression v0.2 From: come@opensides.be (=?ISO-8859-1?Q?C=F4me?= Chilliet) Le vendredi 5 avril 2019, 11:00:59 CEST Micha=C5=82 Brzuchalski a =C3=A9cri= t : > So we're talking about providing incomplete feature now, right? As I understand it, the point is to make unpacking available to arrays, to = be consistent with function calls. // This is already supported $result =3D someFunction($a, $b, ...$array); $result =3D new someClass($a, $b, ...$array); // This is not $result =3D array($a, $b, ...$array); So when building an object I can unpack, but not when building an array, wh= y? So the feature is designed to work the same way as for function parameters,= which is why string keys are not supported, because they are not supported= by the "..." operator for functions. In the end, I see that as making a feature more complete, as the "..." oper= ator which only supported functions will now support array constructors as = well. C=C3=B4me