I check this PHP website benchmark for check switch statement VS if else if statement. And I see this result:
Is a there a difference between switch and if structures?. Call 1'000x
- 141 %
*if and elseif (using ==)*Total time: 165 µsview code - 139 %
*if, elseif and else (using ==)*Total time: 162 µsview code - 110 %
*if and elseif (using ===)*Total time: 128 µsview code - 100 %
*if, elseif and else (using ===)*Total time: 117 µsview code - 149 %
*switch / caseTotal*time: 174 µsview code - 181 %
*switch / case / default*Total time: 211 µsview code
In result i see if else if is faster (+ **100 %** *if, elseif and else (using ===)* Total time: 117 µsview code).
This benchmark is true and if, elseif and else (using ===) is better and faster as switch statement?!
===is faster than==since==tries to make a type conversion if the two values are not equal. The switch-case-statement had only 2 cases (and a default case). I think it gets faster (relative to if-elseif) if you have more cases. But what exactly is your question?