[FX.php List] variables w/ single quotes vs. double quotes & heredoc

Joel Shapiro jsfmp at earthlink.net
Wed Oct 25 13:19:09 MDT 2006


Hi all

Chris Hansen's response to my recent post (multi-line echo  
statements) provoked this post:


I just recently learned that using echo with double quotes (and/or  
heredoc) allows $variables to be used directly within a string --  
without having to separate the $variables with concatenating  
periods.  (And I can see that in this regard using heredoc would  
often be easier than double quotes, because you wouldn't need to  
escape whatever double quotes may exist within the string.)

Searches about this online, however, showed that PHP is slower when  
using double quotes (I'd imagine heredoc as well), since the PHP has  
to look through every string for variables to parse.  Most people  
(online) seemed to say that using single quotes and concatenating  
periods is faster (and cleaner?) for PHP.

Do many people here use double quotes and/or heredoc anyway since  
it's easier?  Do you consider the speed difference inconsequential?

TIA,
-Joel


Joel Shapiro - FileMaker Pro Database Design
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
joelshapiro at jsfmp dot com
http://www.jsfmp.com
415-269-5055


More information about the FX.php_List mailing list