Re: [PHP-DEV] 'switch-expression' and the 'type guard' unary operator demo

2019-10-20 Thread Rowan Tommins
Hi Kosit, There's some really interesting ideas in here, thanks for sharing them. On 19/10/2019 17:40, Kosit Supanyo wrote: Like function declaration and function expression in JavaScript, if `switch` appears as first token at statement level it will be recognized as statement but if `switch`

Re: [PHP-DEV] Adding explicit intent for SWITCH/CASE fall through?

2019-10-20 Thread Rowan Tommins
Hi Mike, On 20/10/2019 01:39, Mike Schinkel wrote: Not yet having experience working on PHP's parser I do not know how it is configured nor what about the design of PHP requires keywords unable to be used as constants, class names, function or method names. I know this is a tangent but that

Re: [PHP-DEV] 'switch-expression' and the 'type guard' unary operator demo

2019-10-20 Thread Kosit Supanyo
Hi Mike Is there a strong reason to change to using fat arrows and colons? The reason is statement/expression semantic. The reason for choosing comma over semicolon is because in PHP semicolons are used only as statement separator while commas are used as expression separator within brackets

Re: [PHP-DEV] Adding explicit intent for SWITCH/CASE fall through?

2019-10-20 Thread Mike Schinkel
> On Oct 20, 2019, at 3:01 AM, A.L.E.C wrote: >>> It might be not useful enough to justify a BC break. > > That was my intention, to find more value in a new feature to justify BC > break. Your point was well taken, which is why I am now suggesting we consider (one of) the following instead

Re: [PHP-DEV] Adding explicit intent for SWITCH/CASE fall through?

2019-10-20 Thread A.L.E.C
On 10/20/19 2:39 AM, Mike Schinkel wrote: >> case X: >> if (something) { >> fallthrough; >>} >> something-else; >> break; >> case Y: > > Interesting. > > What would you expect this to do? It is not intuitively obvious to me. Directly jump to the next