Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109592 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 29312 invoked from network); 12 Apr 2020 11:19:29 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Apr 2020 11:19:29 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3B7E51801FD for ; Sun, 12 Apr 2020 02:48:36 -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-f180.google.com (mail-yb1-f180.google.com [209.85.219.180]) (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 ; Sun, 12 Apr 2020 02:48:35 -0700 (PDT) Received: by mail-yb1-f180.google.com with SMTP id n188so3116937ybc.3 for ; Sun, 12 Apr 2020 02:48:35 -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; bh=6Snwm5p7hN9aAQ2trgIeGvKg25MOcz3wVfYbf/Y57Bo=; b=tkOONy6joVn4INFi1p6pXBDq00x2CAnkeQqB84aWlMfi8IVFvhwV1RQtZTc15CPOP+ akPXSAErJaWyZfHdfgKySFxxdmRvCtYyq5t2/OSzPcoMkknRMZRRq6Z6pRunGQX/mCkd oWneBohPoxBXIjb6l0X+qXy7eYQUcwPhKHrawUdmz3M8ymqOl3lzu/F2Ts0yXXF1GyrH w48QvMyl9TKsDHrfjEeL9T6L/60z/62gmzcADjiapdvOMjHBArYmFOkah5PV0S6QVuwj BicFfQA4K8ec2Wn7ekXYBPWPIViVc7KFxSbAisCocknFqmpGS34uuepEStCEu4Vf0iCt BfVw== 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; bh=6Snwm5p7hN9aAQ2trgIeGvKg25MOcz3wVfYbf/Y57Bo=; b=h7XmDq95w8On12t8ze5Y6S0/RgAN/JIgJghKU99vZxh4btZH0aZNtCOy7thK/x8hbK drXsgooRzHf6jGcjUKZTZrqwsoBpZllqJZ5oCt1UCN7V6nRQM9DELemln9ymCLY/36kL UrGaRTaiXdyI23AupJAOgrarfkEFYJZ7qOqITnnYPQBlnpEbo3aQzRNJQq+yL45kdWIi 3h00+JZipkAUzttN+RxjgM+sb54vLSMMBjmvIj0YV2oz+OUov4XRXei/bcNdXTVmOKhP d2yB+/pTh1ntgb6D8/VEfJc4jnhh4hj74BWmQTQkSmidh//aQtlQJq+mT/69LiIvgFOs sbuA== X-Gm-Message-State: AGi0PuZ1qGZV691Hh1AM7CePgBtFPspM6eP+pJIxRXLrG+lIhE6Y7l1+ B9172B4xR67XwMed+DKUV86csx+nAmSUiOhMLABzfdyt X-Google-Smtp-Source: APiQypKdbkleJBG8qaA/XmbNqfQ7AGSnnpbUOXy7pDGuyM8xAuXvukNgoQhzOa2URyi7E0qlg4HRgmD6URq0CZUdJZk= X-Received: by 2002:a25:3bd0:: with SMTP id i199mr18605634yba.297.1586684913981; Sun, 12 Apr 2020 02:48:33 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sun, 12 Apr 2020 11:48:22 +0200 Message-ID: To: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [DISCUSSION] Match expression From: tovilo.ilija@gmail.com (Ilija Tovilo) Hi George I appreciate your feedback. > One small decision that I personally disagree with is the usage of `=>` compared to using the colon as the switch statement does. I picked the `=>` symbol because IMO the extra spacing and wider symbol visually separates the two sides better. The difference isn't huge, I don't have a strong preference either way. > Also, combining this with less/greater or equal than binary operators makes for a rather confusing line in my eyes. I guess that depends on the lhs. For example, using the ternary operator has the opposite effect. ``` match (true) { // => $cond ? $foo : $bar => $val, // Better $val >= 42 => $val, // Worse // : $cond ? $foo : $bar: $val, // Worse $val >= 42: $val, // Better } ``` Regards, Ilija