Re: Strict switch statements
| From: | Pedro Magalhães | Date: | Fri, 15 Jun 2018 00:41:21 +0000 |
| Subject: | Re: Strict switch statements | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-102270@lists.php.net to get a copy of this message | ||
>
> switch($a){
> case true:
> //will match true, 1, etc...
> break;
> strict case false:
> //will not match anything except boolean FALSE
> //other stuff
> break;
> case false:
> //will match 0, null, etc....
> break;
> }
>
I like this syntax, but I think I'd prefer the other way around. `case
strict false:` describes better what the condition is.
Regards,
Pedro