Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92149 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58725 invoked from network); 7 Apr 2016 20:17:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Apr 2016 20:17:39 -0000 Authentication-Results: pb1.pair.com header.from=bjorn.x.larsson@telia.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=bjorn.x.larsson@telia.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain telia.com from 81.236.60.154 cause and error) X-PHP-List-Original-Sender: bjorn.x.larsson@telia.com X-Host-Fingerprint: 81.236.60.154 v-smtpout1.han.skanova.net Received: from [81.236.60.154] ([81.236.60.154:44665] helo=v-smtpout1.han.skanova.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EF/36-48788-F50C6075 for ; Thu, 07 Apr 2016 16:17:36 -0400 Received: from [192.168.7.7] ([195.198.188.252]) by cmsmtp with SMTP id oGMtarl9eTjSzoGMtaSjTF; Thu, 07 Apr 2016 22:17:32 +0200 To: Markus Fischer , Andrea Faulds References: <45.34.48788.AC056075@pb1.pair.com> <5706B0CE.7030801@fischer.name> Cc: PHP internals Message-ID: <5706C05D.3080906@telia.com> Date: Thu, 7 Apr 2016 22:17:33 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <5706B0CE.7030801@fischer.name> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfMigx4MwLPWGeIr+YmhSN5bgd8GJuv+AKRPNqVXlhI9Qlu3Zb2b22U24uyYfUb8KhQCzC7sg8JjaN/sB8ibdH9QB3WvAC/8ri2Mi+EdRpNn+jrQcJazZ eX4bl9CnewUddG88WIzUtKM3mPuwwUOd3ItPhdUHl/ZMQKSLhhpQ/y9Sy0od9jQKFBmHp+gxq4WhJ7+AAWoicqMQbdT1JXPPwM9pJgOc3BU6+TwLHc0FOuWU Subject: Re: [PHP-DEV] [RFC] Square bracket syntax for array destructuring assignment From: bjorn.x.larsson@telia.com (=?UTF-8?Q?Bj=c3=b6rn_Larsson?=) Den 2016-04-07 kl. 21:11, skrev Markus Fischer: > Hey, > > On 07.04.2016 14:21, Andrea Faulds wrote: >> Bob and I have made an RFC which proposes an alternative syntax for list(): >> >> https://wiki.php.net/rfc/short_list_syntax >> >> Please tell us your thoughts. > Reading the last sample in the RFC: > >> Both due to implementation issues, and for consistency's sake, list() > cannot be nested inside [], nor vice-versa: > [...] >> // This, however, is allowed: >> [[$a, $b], [$c, $d]] = [[1, 2], [3, 4]]; I read it as it's the combination that is not allowed, but nesting list itself works. So adding following to RFC might be enough: "... // This, however, is allowed: [[$a, $b], [$c, $d]] = [[1, 2], [3, 4]]; // In a similar fashion like list(list($a, $b), list($c, $d)) = [[1, 2], [3, 4]];" Anyway, nice and well written RFC, +1! Regards //Björn