Re: What's faster using if else or arrays?
| From: | Robert Cummings | Date: | Thu, 28 Apr 2011 23:19:54 +0000 |
| Subject: | Re: What's faster using if else or arrays? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-312555@lists.php.net to get a copy of this message | ||
On 11-04-28 06:37 PM, dholmes1031@gmail.com wrote:
Thanks switch and case seems to be more faster for the job and a lot cleaner ------Original Message------ From: Andre Polykanine To: dholmes1031@gmail.com Cc: php-general@lists.php.net Subject: Re: [PHP] What's faster using if else or arrays? Sent: Apr 28, 2011 6:17 PM Hello Dholmes1031, I would write it like this: switch($foo) {This sounds like a job for *dun dun dun* GOTO! Kidding, of course ;) Cheers, Rob. -- E-Mail Disclaimer: Information contained in this message and any attached documents is considered confidential and legally protected. This message is intended solely for the addressee(s). Disclosure, copying, and distribution are prohibited unless authorized.case 5: $dothis; break;case 3: $dothat; break; default: $donothing; break; }