Re: Any performance penalties for switch vs. if/else?
| From: | John Vanderbeck | Date: | Tue, 13 Feb 2001 16:37:29 +0000 |
| Subject: | Re: Any performance penalties for switch vs. if/else? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-39436@lists.php.net to get a copy of this message | ||
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" <John.Guynn@telescan.com>
To: "Php (E-mail)" <php-general@lists.php.net>
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: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>