switch() vs if/else if
#3

Quote:
Originally Posted by jlalt
View Post
Result ->

PHP Code:
1. Took 314ms Average0.000000 ms pertime
2. Took 507ms 
Average0.000000 ms pertime
V

I think the last one was slower because the compiler has to "expand" the cases, which results to aprox 1500 cases... So you are comparing 3 ifs with 1500cases... Correct me if I am wrong.
Reply


Messages In This Thread
switch() vs if/else if - by ElMaestro123 - 13.06.2018, 10:42
Re: switch() vs if/else if - by jlalt - 13.06.2018, 10:56
Re: switch() vs if/else if - by 10MIN - 13.06.2018, 11:17
Re: switch() vs if/else if - by jlalt - 13.06.2018, 11:32
Re: switch() vs if/else if - by Logic_ - 13.06.2018, 11:34
Re: switch() vs if/else if - by ElMaestro123 - 13.06.2018, 16:37

Forum Jump:


Users browsing this thread: 3 Guest(s)