Re: Variable as an index
| From: | Chris | Date: | Mon, 22 Dec 2008 00:00:28 +0000 |
| Subject: | Re: Variable as an index | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-284946@lists.php.net to get a copy of this message | ||
Anthony Gentile wrote:
True, it might mean the very slightest in milliseconds...depending on what you're doing/hardware.Connecting to a db will (probably) take longer than most of those differences, let alone running a query & processing the results.
Ternaries that make a lot of people feel awesome because a lot is being accomplished in one line are also more opcodes than their if-else statement equivalents...and often times can be more confusing to future maintainers of the code.I dislike ternaries for their over-use - I've seen nested ternaries and it's taken me 10 mins to read the code.. *shudder*. -- Postgresql & php tutorials http://www.designmagick.com/