Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110701 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 7736 invoked from network); 23 Jun 2020 09:36:42 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 23 Jun 2020 09:36:42 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id BF7DF1804C3 for ; Tue, 23 Jun 2020 01:23:50 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS3301 81.224.0.0/12 X-Spam-Virus: No X-Envelope-From: Received: from v-smtpout1.han.skanova.net (v-smtpout1.han.skanova.net [81.236.60.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 23 Jun 2020 01:23:49 -0700 (PDT) Received: from [192.168.7.8] ([213.64.245.126]) by cmsmtp with ESMTPA id neDbjTMYIvaXxneDbjpKia; Tue, 23 Jun 2020 10:23:47 +0200 To: Benas IML , Ilija Tovilo Cc: PHP internals References: <37f1f8fb-0e1b-cc39-f4b6-6c943a731d49@telia.com> <250b7671-2919-9385-c149-931212397e4b@telia.com> <04d86e2d-0815-195a-6111-3034e0ca5918@telia.com> Message-ID: Date: Tue, 23 Jun 2020 10:23:47 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-CMAE-Envelope: MS4wfGa0KYLyTMi09cxOjG3ZJYy+DR7tWcqqO6tmWEZBaeSMDPk1gStnJfn6Ec2JaxITNQDsmrCoSB1pb4kiAERiVuh92AFGkmwul/WYIwue2zshvdG5psXX t+Yh4YQKjH/FU6h5h2dK4F56dNeBfI4w9LpkJevHlO5voJBDlAtPuEYuWxqaY3iSV2orUOebzmwz7Oz8A6NUGSNaapp+0hvaEAOKyZmKigGAwTLsi1w2mOfV xdbE8TI//q7jLkDcaTFDrA== Subject: Re: [PHP-DEV] Re: [RFC][DISCUSSION] Match expression v2 From: bjorn.x.larsson@telia.com (=?UTF-8?Q?Bj=c3=b6rn_Larsson?=) Den 2020-06-22 kl. 18:05, skrev Benas IML: > On Mon, Jun 22, 2020, 6:35 PM Björn Larsson > wrote: > >> Hi Ilija,Den 2020-06-18 kl. 22:51, skrev Ilija Tovilo: >> >>> Hi Björn >>> >>>>> I'd like to announce the match expression v2 RFC: >>>>> https://wiki.php.net/rfc/match_expression_v2 >>>> Well one could argue that when working with legacy code containing >>>> switch statements where one gradually migrates to match, it might be >>>> easier to have the same separator, i.e. ":". >>> I think that's somewhat of a moot point. The syntax of match is quite >>> different (match instead of switch, no case, no break, colon instead >>> of case, comma instead of semicolon, trailing semicolon). Just making >>> one of those the same doesn't make a meaningful difference for ease of >>> migration. >> Agree on that! One thing though. Is semicolon mandatory or is it optional >> like in the first RFC? Feels a bit odd with a semicolon after a curly >> bracket. >> > It's mandatory since it's an expression, not a block. Another example of an > expression would be a closure: > > ``` > $fn = function () { > ... > }; // a semicolon is mandatory here. > ``` Absolutely so. I was thinking of the case mentioned in v1 RFC when it's used as a stand-alone expression. match ($y) { ... };  ` Optional? r//Björn L