<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Simple measures to a faster PHP app &#8211; Part 1 Double Quotes</title>
	<atom:link href="http://www.saiweb.co.uk/php/simple-measures-to-a-faster-php-app-part-1-double-quotes/feed" rel="self" type="application/rss+xml" />
	<link>http://www.saiweb.co.uk/php/simple-measures-to-a-faster-php-app-part-1-double-quotes</link>
	<description>Ramblings of a Sys admin</description>
	<lastBuildDate>Mon, 06 Feb 2012 14:55:58 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Buzz</title>
		<link>http://www.saiweb.co.uk/php/simple-measures-to-a-faster-php-app-part-1-double-quotes/comment-page-1#comment-15842</link>
		<dc:creator>Buzz</dc:creator>
		<pubDate>Fri, 15 Jan 2010 16:51:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.saiweb.co.uk/?p=796#comment-15842</guid>
		<description>@bucabay

I did say &quot;don’t use “” if you do not need to!&quot; as with all things this needs to be your own best judgment, there are of course caveats such as sacrificing functionality for performance, which in some cases as you say may be a minor gain.

Thanks for the reference material though always appreciated :-)</description>
		<content:encoded><![CDATA[<p>@bucabay</p>
<p>I did say &#8220;don’t use “” if you do not need to!&#8221; as with all things this needs to be your own best judgment, there are of course caveats such as sacrificing functionality for performance, which in some cases as you say may be a minor gain.</p>
<p>Thanks for the reference material though always appreciated <img src='http://cdn.saiweb.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bucabay</title>
		<link>http://www.saiweb.co.uk/php/simple-measures-to-a-faster-php-app-part-1-double-quotes/comment-page-1#comment-15554</link>
		<dc:creator>bucabay</dc:creator>
		<pubDate>Sat, 09 Jan 2010 09:32:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.saiweb.co.uk/?p=796#comment-15554</guid>
		<description>Hi Buzz,

The reason double quotes is slower, is that the string is parsed. Everything is single quotes is taken literally and thus not parsed. Thus you should not compare the speed, but the functionality of the two. Speed should only be an issue if it really it negatively effects performance. Using double quotes can be very beneficial in that you do not have to concatenate strings together with variables and escapes. 

Unless you are working with very huge strings, the performance difference is negligible. Many other factors become important way before that. A good approach is to understand bottlenecks (such as disk), and performance of code. see: http://en.wikipedia.org/wiki/Computational_complexity_theory

Here is a good article on micro-optimization (which is what you&#039;re doing when using single quotes instead of double quotes). Though published in 2006, it still applies today. 
http://www.acm.org/ubiquity/views/v7i24_fallacy.html</description>
		<content:encoded><![CDATA[<p>Hi Buzz,</p>
<p>The reason double quotes is slower, is that the string is parsed. Everything is single quotes is taken literally and thus not parsed. Thus you should not compare the speed, but the functionality of the two. Speed should only be an issue if it really it negatively effects performance. Using double quotes can be very beneficial in that you do not have to concatenate strings together with variables and escapes. </p>
<p>Unless you are working with very huge strings, the performance difference is negligible. Many other factors become important way before that. A good approach is to understand bottlenecks (such as disk), and performance of code. see: <a href="http://en.wikipedia.org/wiki/Computational_complexity_theory" rel="nofollow">http://en.wikipedia.org/wiki/Computational_complexity_theory</a></p>
<p>Here is a good article on micro-optimization (which is what you&#8217;re doing when using single quotes instead of double quotes). Though published in 2006, it still applies today.<br />
<a href="http://www.acm.org/ubiquity/views/v7i24_fallacy.html" rel="nofollow">http://www.acm.org/ubiquity/views/v7i24_fallacy.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Buzz</title>
		<link>http://www.saiweb.co.uk/php/simple-measures-to-a-faster-php-app-part-1-double-quotes/comment-page-1#comment-13794</link>
		<dc:creator>Buzz</dc:creator>
		<pubDate>Mon, 30 Nov 2009 14:25:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.saiweb.co.uk/?p=796#comment-13794</guid>
		<description>You kinda missed the point see i.e (in Example) ... as in the double quoted string was an example, as in NOT optimized ...

Anywho congrats on the new edition :-)</description>
		<content:encoded><![CDATA[<p>You kinda missed the point see i.e (in Example) &#8230; as in the double quoted string was an example, as in NOT optimized &#8230;</p>
<p>Anywho congrats on the new edition <img src='http://cdn.saiweb.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean Barton</title>
		<link>http://www.saiweb.co.uk/php/simple-measures-to-a-faster-php-app-part-1-double-quotes/comment-page-1#comment-13675</link>
		<dc:creator>Sean Barton</dc:creator>
		<pubDate>Thu, 26 Nov 2009 23:58:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.saiweb.co.uk/?p=796#comment-13675</guid>
		<description>Sadly Buzz your PHP is still in need of some &#039;help&#039; :) However you are a man after my own heart. Single quotes are indeed wonderful and actually now I have been using them solely for a couple of years they are the norm for me. 

You were incorrect with your “this\nstring\nappears\over\nmany\nlines” comment. The correct single quote method would be...

&#039;this&#039; . &quot;\n&quot; . &#039;string&#039; . &quot;\n&quot; . &#039;appears&#039; . &quot;\n&quot; . &#039;over&#039; . &quot;\n&quot; . &#039;many&#039; . &quot;\n&quot; . &#039;lines&#039;

Or perhaps:

$array = array(&#039;this&#039;, &#039;string&#039;, &#039;appears&#039;, &#039;over&#039;, &#039;many&#039;, &#039;lines&#039;);
$string = implode(&quot;\n&quot;, $array);

Although the second one is more elegant I doubt it&#039;s really any good for static text. Feel free to run speed tests though.

cheers
Sean

ps: now a dad!</description>
		<content:encoded><![CDATA[<p>Sadly Buzz your PHP is still in need of some &#8216;help&#8217; <img src='http://cdn.saiweb.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  However you are a man after my own heart. Single quotes are indeed wonderful and actually now I have been using them solely for a couple of years they are the norm for me. </p>
<p>You were incorrect with your “this\nstring\nappears\over\nmany\nlines” comment. The correct single quote method would be&#8230;</p>
<p>&#8216;this&#8217; . &#8220;\n&#8221; . &#8216;string&#8217; . &#8220;\n&#8221; . &#8216;appears&#8217; . &#8220;\n&#8221; . &#8216;over&#8217; . &#8220;\n&#8221; . &#8216;many&#8217; . &#8220;\n&#8221; . &#8216;lines&#8217;</p>
<p>Or perhaps:</p>
<p>$array = array(&#8216;this&#8217;, &#8216;string&#8217;, &#8216;appears&#8217;, &#8216;over&#8217;, &#8216;many&#8217;, &#8216;lines&#8217;);<br />
$string = implode(&#8220;\n&#8221;, $array);</p>
<p>Although the second one is more elegant I doubt it&#8217;s really any good for static text. Feel free to run speed tests though.</p>
<p>cheers<br />
Sean</p>
<p>ps: now a dad!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using apc
Database Caching 2/12 queries in 0.031 seconds using apc
Object Caching 437/446 objects using apc
Content Delivery Network via Rackspace Cloud Files: cdn.saiweb.co.uk

Served from: www.saiweb.co.uk @ 2012-02-08 21:58:10 -->
