Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:112508 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 66258 invoked from network); 14 Dec 2020 23:42:07 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Dec 2020 23:42:07 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4D18F180504 for ; Mon, 14 Dec 2020 15:12:55 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_05,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-Virus: No X-Envelope-From: Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com [209.85.167.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 ; Mon, 14 Dec 2020 15:12:54 -0800 (PST) Received: by mail-oi1-f180.google.com with SMTP id s75so21214798oih.1 for ; Mon, 14 Dec 2020 15:12:54 -0800 (PST) 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=Dk/xM1XlxSoZYQd3oxfkeCeFsMPzWW2wagciKHALiTk=; b=jqOXgg/PgTEfM8MQiRWhWSTMU2wDyOZ0xYFrPxaLGd8EmBDuseEgV9hYRYdwXWc2kf 4c9FrisGzLii+KZLL21Y5ex/keF/twA5hWVN3udLTEWzSV2vWabzw+f5h9P4djMGgGwV TtecNergCop50dcyJ41FFkqisZo3pFTq/33aJPLqQ0lAjNqOPYgQzuFq6BbFemGMS6G6 j6D4txaN6iXQ9NrX8N6gdFZSgDIyOfVEpQZfkToYRALCRbKbz79GwLYE6u5Y5L/qlXxr fh8lkqSJqGF5fSTRNpd5ziJaqonwCWaFnvo503SZPrwQoRL/hdHRXeQlcGBwO4npem3R ZpfQ== 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=Dk/xM1XlxSoZYQd3oxfkeCeFsMPzWW2wagciKHALiTk=; b=h5Mg/R499BSGlL3UDoIFJBqFqHk/BYa6aZuE7ZAhplzxRKo8B5X/W69eFnc5Rrcu9V ED2NIL0UgMiRxiPwv6leIKw/3yPwySr6X7FMQohZ1IfF4v1TECzFuRLgfmskuz3anHhf BwAhP2wmpFyTS1P5sPVMLb4XkMZxcKDkS/CzrKcvbeFPJ2VVsPvetn1yMprttoauHnZ1 EL6roZShv9cNQtuZKTLOA44MOUKRLDp4NiNLFZK0119AmYIQpm4clPFSJKHaajNVUtgo 955m6ogvqz2fcXy/KmabcgGfyNjmcp6ZXWOLG5QCvZhaqNDQ1Qlce7r7zY10V6c5Lg2J btEQ== X-Gm-Message-State: AOAM530qc/n/eFarbdvEBxU57Zgaztg468r/RlMDLojD8fk43vQNwD5v o8y6+x95LAjDUbDMZLQhkQiwTNYCAqaHeQnQqA== X-Google-Smtp-Source: ABdhPJyytdGWXkpd7NPmrZM91mkq7Y+kE1WBLE6+yscOhhUdKcKiSxEEqN80B5qeakHGpSGeshS0jQxPH4V1SBeUmiY= X-Received: by 2002:aca:afd0:: with SMTP id y199mr19798661oie.7.1607987572773; Mon, 14 Dec 2020 15:12:52 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 14 Dec 2020 15:12:38 -0800 Message-ID: To: Sara Golemon Cc: Doug Nelson , Marco Pivetta , Larry Garfield , php internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] Short-match From: paul.crovella@gmail.com (Paul Crovella) On Mon, Dec 14, 2020 at 1:23 PM Sara Golemon wrote: > > On Mon, Dec 14, 2020 at 2:24 PM Doug Nelson wrote: > > > Both you and Sara at different points have talked about thinking was bad > > practice, but I've not read anything compelling about why it should be > > considered as such. > > > > > I'm not a full -1 on the concept (especially as match(true) has the > convenience of returning a value), but it's very square peg in a round hole > to me. > > At the end of the day though, that's a style choice and not one I have any > business imposing on anyone, and certainly within the context of this diff, > the actual change is trivial. It's sugar for match(true) that looks like > match. /shrug > > I might suggest broadening the scope to include `switch` as well though. > If we're going to codify match(true) as a pattern, we should at least be > consistent about it. > > -Sara I lean more on the side of +1 but otherwise agree with Sara here. I'm apathetic on including switch but it's worth considering. If this (slightly) better aligns someone's code with how they're thinking about the problem then yay.