In most cases, using a switch is preferrable. The code is cleaner, and the
performance increases.  This is true accross languages.

- John Vanderbeck
- Admin, GameDesign

----- Original Message -----
From: "John Guynn" <[EMAIL PROTECTED]>
To: "Php (E-mail)" <[EMAIL PROTECTED]>
Sent: Tuesday, February 13, 2001 11:34 AM
Subject: [PHP] Any performance penalties for switch vs. if/else?


> If I have a complex if else statement and I replace it with a switch case
> statement do I loose any performance?  I would think I would gain
> performance and the code is definitely easier to maintain but I wanted
some
> other opinions.
>
> John Guynn
>
> This email brought to you by RFCs 821 and 1225.
>
>
> --
> PHP General 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 General 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