On 01/04/2020 12:19, Ilija Tovilo wrote:

We can't really do that since break already accepts an integer telling
it how many enclosing structures it should jump out of.


Sure, but we could use "return", or some other keyword. My point was that the syntax could look a lot closer to a switch statement if that was the aim.

I think I like your existing syntax proposal better on its own merit, it just doesn't look anything like a switch statement, so I'd pick a new keyword like "match" or "select".


Yes, I can absolutely see your point. The point of the poll is to see
what direction we should take. After that I'll try to clean up the
RFC.


I don't have karma to vote, but if I did, my answer to your poll would be "something else". I don't see "match" (or whatever we decide to call it) as a replacement for switch, or as a version of it. It would replace some uses of switch, just as switch replaces some uses of elseif, but in some ways it would be more related to the ternary operator - an expression with branches for different conditions, not a form of flow control.


Regards,

--
Rowan Tommins (né Collins)
[IMSoP]

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to