What is faster: if or switch?
#1

I'd really like to know if any of these two is faster than the other one.
Personally i think no cause it basically is the same, but i'd still like to know.
Hope someone can tell me, thanks.

PHP код:
switch(listitem)
{
    case 
0: .....
    case 
1: .....
    default: .....

or

PHP код:
if(listitem == 0)
{
....
}
else if(
listitem == 1)
{
....
}
else
{
....

greetings Marcel
Reply


Messages In This Thread
What is faster: if or switch? - by BiosMarcel - 10.01.2016, 19:20
Re: What is faster: if or switch? - by Darkwood17 - 10.01.2016, 19:28
Re: What is faster: if or switch? - by BiosMarcel - 10.01.2016, 19:42
Re: What is faster: if or switch? - by Runn3R - 10.01.2016, 20:45
Re: What is faster: if or switch? - by Vince - 10.01.2016, 21:48

Forum Jump:


Users browsing this thread: 1 Guest(s)