Re: [VOTE] match expression
| From: | Larry Garfield | Date: | Wed, 29 Apr 2020 13:33:16 +0000 |
| Subject: | Re: [VOTE] match expression | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-109922@lists.php.net to get a copy of this message | ||
On Wed, Apr 29, 2020, at 1:41 AM, Ilija Tovilo wrote:
> > Or for that matter... is anyone actually using that syntax in the wild, or is it
> > hypothetical?
>
> It's quite common in C (you can't declare variables directly in a
> switch case) so I'd guess it would be used at least by some people in
> PHP.
>
> The worst part is that your code wouldn't throw, it would just start
> behaving differently.
>
> Looking at grep.app you'll find quite a few of them.
> https://grep.app/search?q=%3A%20%7B&filter[lang][0]=PHP
> (Note that searching with regex won't work as that only shows a very
> small subset of results.)
>
> Ilija
Well, poopy.
I still think splitting the RFC in half (rust-style match and Go-style switch) is the correct way
forward, whatever the syntax particulars.
--Larry Garfield