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

2020-04-23 Thread tyson andre
Hi Ilija, > This is because we don't generate a jumptable when there are less than > 5 integer conditions. Because of this inconsistency I'm not sure if we > should just remove the warning. As you mentioned, it could be > intentional in some cases. Tyson also mentioned that some constants > are

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

2020-04-23 Thread Ilija Tovilo
Hi Dan > I don't think PHP can guarantee to detect duplicate conditions This warning is only shown if duplication is guaranteed, namely when a jumptable is generated. Which also makes the check fairly cheap. > Would the duplicate condition* below be detected? No, as jumptables are only

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

2020-04-23 Thread Dan Ackroyd
On Mon, 20 Apr 2020 at 19:20, Ilija Tovilo wrote: > Just a heads up, I'd like to start the voting on the match expression > RFC in a couple of days. > The jury is still out on: > > <*multiple issues> > > If you have anything new to add to the discussion, this is your chance! > On Mon, 20 Apr

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

2020-04-20 Thread Ilija Tovilo
Hi internals Just a heads up, I'd like to start the voting on the match expression RFC in a couple of days. https://wiki.php.net/rfc/match_expression I have made a number of changes to the RFC. * Block return values are now allowed but limited to match arms

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

2020-04-15 Thread Ilija Tovilo
Hi Andrea > Well, I don't think we have any other expressions that are also > statements with very slightly different syntax The syntax isn't actually different. We don't have different grammar for the match statement and expression. There's only one. Think of it more like a type check. In other

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

2020-04-14 Thread Andrea Faulds
Hi Ilija, Ilija Tovilo wrote: I share others' concern that it is inconsistent with PHP's existing statements Can you elaborate on what exactly the concerns are? Well, I don't think we have any other expressions that are also statements with very slightly different syntax, and in this RFC

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

2020-04-14 Thread Ilija Tovilo
Hi Andrea I realize there's a lot of noise in the mailing list right now, I'll keep this my only e-mail for today. > I share others' concern that it is inconsistent with PHP's > existing statements Can you elaborate on what exactly the concerns are? Note that even if we added block expressions

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

2020-04-13 Thread Andrea Faulds
Hi Ilja, Ilija Tovilo wrote: Hi internals I'd like to announce the match expression RFC that replaces the switch expression RFC I announced a few weeks ago. New: https://wiki.php.net/rfc/match_expression I like this proposal in general, I've wanted something like Haskell and Rust's