Christian Stoller wrote (on 25/09/2014):
Am I missing something equally obvious there? Or just, it doesn't
>interest people much as an idea?
Why should one add a new operator in that context if it is already
possible with assigments as expressions?
This makes the language more complex without getting any improvement.
Sorry, I was talking about this bit:
Currently, switch always uses a "loose" comparison (==), so cannot
distinguish between "case 3" and "case 3.0". Occasionally, it would be
nice to switch on a strict comparison (===); but then I thought, why
stop there? What if you could use switch with any comparison operator?
My idea is to give the switch() statement an optional "use" clause
(since that's an existing keyword) containing a single comparison operator
See my earlier e-mail for examples and further details. Maybe I should
have given it its own thread so it was more visible; the idea has been
brewing for a while, I just thought this thread was a convenient place
to mention.
--
Rowan Collins
[IMSoP]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php