Re: [RFC] Short-match

From: Date: Mon, 14 Dec 2020 21:23:16 +0000
Subject: Re: [RFC] Short-match
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-112503@lists.php.net to get a copy of this message
On Mon, Dec 14, 2020 at 2:24 PM Doug Nelson <dougnelson@silktide.com> 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


Thread (29 messages)

« previous php.internals (#112503) next »