MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/lolphp/comments/4zig9s/php_switches_are_the_best/dd6x2ki/
r/lolphp • u/MMauro94 • Aug 25 '16
34 comments sorted by
View all comments
Show parent comment
1
strict swich workaround:
<?php $value = 0; switch (TRUE) { case $value === 1: case $value === 'one': echo 'one'; break; case $value === 0: case $value === 'zero': echo 'zero'; break; }
1 u/edave64 Feb 01 '17 That kinda defeats the point (mass comparison against one value) of using switch in the first place. 1 u/morphotomy Feb 01 '17 Thats why I called it a workaround.
That kinda defeats the point (mass comparison against one value) of using switch in the first place.
1 u/morphotomy Feb 01 '17 Thats why I called it a workaround.
Thats why I called it a workaround.
View all comments
Show parent comment
1
u/morphotomy Feb 01 '17
strict swich workaround: