Den 2020-12-14 kl. 22:23, skrev Sara Golemon:
On Mon, Dec 14, 2020 at 2:24 PM Doug Nelson <dougnel...@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
I think it's a good point to keep it consistent with switch,
i.e. if moving forward make the same change in switch. Then
when mixing and matching on at least don't need to remember
where true is needed...
r//Björn L
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php