On 23/09/2016 16:59, Stephen Reay wrote:
I would however love a way to have strict comparisons in a switch statement.

I've been pondering an idea for ages of a generalised syntax for switch to specify an operator to use, so you'd do something like this:

switch ( $foo ) use ( === ) {
    case 1:
       something();
    break;
    case '1':
       not_the_same_thing();
    break;
}

At some point, I'll get round to attempting a proof of concept and writing up an RFC...

Regards,
--
Rowan Collins
[IMSoP]

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

Reply via email to