On Mon, Dec 14, 2020 at 1:23 PM Sara Golemon <poll...@php.net> wrote: > > 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 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. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php