By the way, often compilers change switch() to if()/else() if they know 
that it would be faster (if you only have like 2 cases) so if the code is 
much nicer you don't need to be too afraid of switch() :)

Andi

At 03:44 PM 2/3/2001 +0200, Boian Bonev wrote:
>hi,
>
>
> > > What do you mean, switch() is expensive?
> > Well, isn't it slower?
>
>perhapse in php switch is slower. in c it sometimes is much faster than
>bunch of if statements. i mean the compiler makes jump tables for
>consequitive values and there are less comparisons etc. just a range check
>and jump.
>
>b.
>
>
>--
>PHP CVS Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to