Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110675 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 11819 invoked from network); 18 Jun 2020 22:05:19 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 18 Jun 2020 22:05:19 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 50677180509 for ; Thu, 18 Jun 2020 13:51:20 -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, 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-yb1-f177.google.com (mail-yb1-f177.google.com [209.85.219.177]) (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 ; Thu, 18 Jun 2020 13:51:19 -0700 (PDT) Received: by mail-yb1-f177.google.com with SMTP id h39so3814270ybj.3 for ; Thu, 18 Jun 2020 13:51:19 -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 :content-transfer-encoding; bh=S47Yo4nPArOCve6JS3ANiuaYAD6XNsdH/O1wfWFBpTA=; b=JNuUXmUDly4umKtYbaiE0XlR1AaVOv11Dye6JbcPWuYquFvb+kfXX68lV8ZDNEUbzV q1kRrh/AirUeESO/T60Jrau6ha8IrveJSE4B4mUbu5qRdGDudJR2TTfYauuutE9QAL3E My9Au0qRD+sTtkES1KPlRKDmhKSmFwmxoc7SXLOQQTZl8HVPki1EE3SXC8PysRkk/0hk m4CWGEtCKap1gfkUfet8boLr6lNdhGJ9Wk73ac2bRaEPt6xbapB7912AzTcTpwi9Os5S lPWdp/gDMfOZnlp/ZErvU4iFHiJXJEPN0e2QROV9thKs/j8j5gVKbNEXgUbubbySMsP7 OV8g== 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:content-transfer-encoding; bh=S47Yo4nPArOCve6JS3ANiuaYAD6XNsdH/O1wfWFBpTA=; b=jFRAbcl1+XoE2HhB79caPPacWxjkwHlAxv/OkmB4a4Uqz67hGufnRhE+n9OdrHTfwJ bgCho5yYglu7Vr+IWs/1r7qFhDFI9xr47cRJ3J1AjDsEW3XfLpKpcKP9dNXWwpXMtIyp h4yXPrnSikhrG45PlhIwCDvp3Po+HXIO2ho5gjuH8WP8HdspCs795DYYeoq9K/67vZLH 9VGjKUfr+7v+Ivm/QQbEh32iO/fxIXuftBrekYiU+3y6LJSGgXL9lZ0YXi0/PZOLtgqr y05RKOtWU0fhJW30zkvChWn9QLtzm2uk7aEh9wWlS/M9qylWsaK/FNDsueyrNvjAJqoa LSWA== X-Gm-Message-State: AOAM531BLrI2l8CuI+kcuLHLaJ9ardbYFpxdrn8lmmzahUDg3sT8Qd2T DYFA4zJ52iSYpLx2b4vdkhotgTCTuvZ8L2pfkIPht70L X-Google-Smtp-Source: ABdhPJyiwASFEJc02bOS9+jPGR7r3xtjPCXrAffXloyZeag2Pq+coL5TnjxSwdXFOvcaAdmIjB6jqar0vzWew6Tn+78= X-Received: by 2002:a25:af93:: with SMTP id g19mr860284ybh.109.1592513479081; Thu, 18 Jun 2020 13:51:19 -0700 (PDT) MIME-Version: 1.0 References: <37f1f8fb-0e1b-cc39-f4b6-6c943a731d49@telia.com> <250b7671-2919-9385-c149-931212397e4b@telia.com> In-Reply-To: <250b7671-2919-9385-c149-931212397e4b@telia.com> Date: Thu, 18 Jun 2020 22:51:07 +0200 Message-ID: To: PHP internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [RFC][DISCUSSION] Match expression v2 From: tovilo.ilija@gmail.com (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 of migration. > Is the proposed =3D> separator inspired by Rust or Scala? Checked what > other languages used and for switch it's ":" of course. So one might > argue that to align with match statements in other languages "=3D>" is > a good choice, but OTOH if ones sees match as an enhanced switch, > having ":" as a separator is another alternative. Since nobody else asked for it, just for you I compiled a list of other languages :) https://gist.github.com/iluuu1994/11ac292cf7daca8162798d08db219cd5 The conclusion: Most languages also use some form of arrow. It makes sense to me to stay consistent with those languages. Ilija