Re: Code optimization: single vs. double quotes?
| From: | Shawn McKenzie | Date: | Fri, 24 Oct 2003 02:58:21 +0000 |
| Subject: | Re: Code optimization: single vs. double quotes? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-167384@lists.php.net to get a copy of this message | ||
Thanks guys! I want to hear all opinions, but hopefully a PHP dev will give
us the straight poop.
-Shawn
"Shawn McKenzie" <nospam@mckenzies.net> wrote in message
news:20031024004349.96868.qmail@pb1.pair.com...
> I came across this post and was hoping to get a gurus opinion on the
> validity. TIA
>
> -Shawn
>
> I remember reading somewhere re: PHP coding that it is a better coding
> practice to use single quotes as much as possible vs. using double quotes
in
> scripts. When using double quotes, you are forcing PHP to look for
variables
> within them, even though there may not be any, thus slowing execution
> time...
>
> For example it is better to code:
> Code:
> echo '<td
> bgcolor="'.$bgcolor2.'"> </td></tr>';
>
> vs.
> Code:
> echo "<td
> bgcolor=\"$bgcolor2\"> </td></tr>";