[nycphp-talk] Stupid Question - difference between using single and double quotes
Chris Shiflett
shiflett at php.net
Mon Mar 29 11:53:20 EST 2004
--- "Christopher R. Merlo" <cmerlo at ncc.edu> wrote:
> It should be noted also that using the single quotes where
> appropriate is more efficient; it lets the parser know that there's
> nothing to evaluate.
If you're like me and also concerned with your own efficiency (and
supporting your general laziness), there's also the benefit of not having
to escape quotes within single quotes or single quotes within quotes:
$foo = "This doesn't require escaping.";
$bar = '"Cool," said Chris.';
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly
Coming Fall 2004
HTTP Developer's Handbook - Sams
http://httphandbook.org/
PHP Community Site
http://phpcommunity.org/
More information about the talk
mailing list