Re: [PHP-DEV] Re: [RFC][DISCUSSION] Match expression v2

This is only part of a thread. view whole thread
June 8, 2020 06:13 (Peter Stalman)
On Fri, Jun 5, 2020 at 3:10 PM Ilija Tovilo> wrote:
> > Hi internals > > > I'd like to announce the match expression v2 RFC: > > > > Small reminder: Two weeks have passed since I announced the match v2 > RFC with little new discussion. I'll leave it open for another two > weeks and put it to a vote then if there are no objections. I will > send another reminder one day before I do. > > Ilija > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: >
I really like this addition. 👍 It's a great way to decrease code verbosity without getting in the way of anything else. Much better without the blocks too, since with blocks you might as well use functions or `switch`. I see you mentioned pattern matching, but I think this can be done quite well in userland. Have you thought about including ranges, greater/less than, or some form of `in_array()` matching? As for making the `(true)` optional, even though many are in favour of it. to me that seems like something that would happen when/if the `while (true)` becomes optional. There's a million examples of the latter on github, and I think it would be odd to make this optional while (no pun intended) the `while` one would not be. Thanks, Peter