Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110703 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 9686 invoked from network); 23 Jun 2020 09:43:16 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 23 Jun 2020 09:43:16 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 09FD91804E4 for ; Tue, 23 Jun 2020 01:30:25 -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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 23 Jun 2020 01:30:24 -0700 (PDT) Received: by mail-lj1-f176.google.com with SMTP id q19so22474042lji.2 for ; Tue, 23 Jun 2020 01:30:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zCk2Rz2IHUJZcF00aREGr1kw4uQbXd/b4Esf9D7RrAk=; b=sn33OPfLphw2ODFxV81+4KW9w1wDiVyuYKQXJi7bLcwaAIlfP3znZsTVQQ6iV7r2lT UgC8GM+XqaM8uxxS/khxH7QdvibNQjJvJuWCJ62bKX24yjGO5cVCSlfY86FF4nXddWu+ 4qKFmls61OIhQKn7yxFTG+Lpbeg62V6BQXnkLalFjDX8JJVrVsgtkLG7b4IvNPhwdx17 raj55UaihjKMqccfx96s5Ul5rtBXnajQba7zNpFdDxjHDuqd7qCAxnIwcrd+w3SARMrR olllwrQD80XpqLpy5t+2jIvRrsgZBZLI+eYZrUXFBLK26RSQTwAxhpcSBQau3YC8G65K p0Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zCk2Rz2IHUJZcF00aREGr1kw4uQbXd/b4Esf9D7RrAk=; b=hFJzxxHN0SBIZ6kRepLncTcOIS2KDFuaVSboCA7H0Q6jngUiW4Tm1ZAo7lLJE9a75r q7i2apA4RVF5Hy4hLGdhgkF1c0LVUQkHG3R+Pl0Sp1WGY+RfcYKbkUaS655DUs2vsl7t jnJVso6ugT2Z9i0LHqYhmfIHPREY6kfN6mHbE2swIZGmp0NTRqF3y6rxRbHz2d7yeOIH HgGUq0iBYPXJlSQx0yhSiCdQWFyBC+GK7scE5AwXzm/PeB5ZETAxyEhEKoi6CQKdT5Bt AyPmQfvTEAzOQuBwiuYlHn1Nz/rP8SpZyBDr8Jd7tx2wF0Ss475G59qa3i5T4n6YnTS8 x/zg== X-Gm-Message-State: AOAM532HZhSGaTNMnI6plGewVFi+odSurqXgpumhZ6gcQqJg4eieEgEn rWExI0IOtntJYB27KhYjDz71mIdoYH0YW489k1Q= X-Google-Smtp-Source: ABdhPJyC6tI/J2QRBjtfdBkFzbsVhahcBs9qpQeXjPfknwyLXw/8wPudcMlkQtwKCXCzHG/xO/Eb77jcl8JYSN8UKkU= X-Received: by 2002:a2e:a0ca:: with SMTP id f10mr10891580ljm.96.1592901020786; Tue, 23 Jun 2020 01:30:20 -0700 (PDT) MIME-Version: 1.0 References: <37f1f8fb-0e1b-cc39-f4b6-6c943a731d49@telia.com> <250b7671-2919-9385-c149-931212397e4b@telia.com> <04d86e2d-0815-195a-6111-3034e0ca5918@telia.com> In-Reply-To: Date: Tue, 23 Jun 2020 11:30:07 +0300 Message-ID: To: =?UTF-8?Q?Bj=C3=B6rn_Larsson?= Cc: Ilija Tovilo , PHP internals Content-Type: multipart/alternative; boundary="00000000000081ae1605a8bc2bde" Subject: Re: [PHP-DEV] Re: [RFC][DISCUSSION] Match expression v2 From: benas.molis.iml@gmail.com (Benas IML) --00000000000081ae1605a8bc2bde Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jun 23, 2020, 11:23 AM Bj=C3=B6rn Larsson wrote: > Den 2020-06-22 kl. 18:05, skrev Benas IML: > > > On Mon, Jun 22, 2020, 6:35 PM Bj=C3=B6rn Larsson > > wrote: > > > >> Hi Ilija,Den 2020-06-18 kl. 22:51, skrev Ilija Tovilo: > >> > >>> Hi Bj=C3=B6rn > >>> > >>>>> 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 o= f > >>> 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 o= f > an > > expression would be a closure: > > > > ``` > > $fn =3D 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) { > ... > }; > Then it's not a standalone expression but a block. In this case, you cannot add an optional semicolon at all. But this RFC v2 is not proposing to add a block, therefore you won't be allowed to use `match` construct as a standalone expression anyways. ` Optional? > > r//Bj=C3=B6rn L > --00000000000081ae1605a8bc2bde--