Hi, On Thu, Jun 14, 2018 at 7:53 AM, Sara Golemon <poll...@php.net> wrote: > Just for casual discussion at this point: > https://github.com/php/php-src/pull/3297 > > switch ($a) { > case FOO: > // Works exactly as current behavior. > break; > case == FOO: > // Nearly identical, though not using the ZEND_CASE optimization. > // Can probably make this equivalent to `case FOO`, but it felt > like an interesting direction. > break; > case === FOO: > // Only triggers if `$a === FOO`, no type juggling > break; > } > > Love it? Hate it? See obvious flaws? The implementation is just a > rushed proof of concept, not something I've labored over, it may well > have bugs. Certainly wouldn't target anything earlier than 7.4, if at > all. >
I love it for the === part. Countless times I've had to avoid switch statements because they can't do strict comparisons. Cheers, Andrey. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php