<?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: Common PHP Programming Mistakes</title>
	<atom:link href="http://www.devtheweb.net/blog/2009/09/30/common-php-programming-mistakes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.devtheweb.net/blog/2009/09/30/common-php-programming-mistakes/</link>
	<description></description>
	<lastBuildDate>Thu, 20 Oct 2011 13:37:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: admin</title>
		<link>http://www.devtheweb.net/blog/2009/09/30/common-php-programming-mistakes/#comment-34</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Sun, 03 Jan 2010 20:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://dev-the-web.com/blog/?p=199#comment-34</guid>
		<description>Thanks, it&#039;s fixed now :)</description>
		<content:encoded><![CDATA[<p>Thanks, it&#8217;s fixed now <img src='http://www.devtheweb.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shyzwbtk</title>
		<link>http://www.devtheweb.net/blog/2009/09/30/common-php-programming-mistakes/#comment-33</link>
		<dc:creator>shyzwbtk</dc:creator>
		<pubDate>Tue, 27 Oct 2009 05:28:08 +0000</pubDate>
		<guid isPermaLink="false">http://dev-the-web.com/blog/?p=199#comment-33</guid>
		<description>&lt;strong&gt;shyzwbtk...&lt;/strong&gt;

shyzwbtk...</description>
		<content:encoded><![CDATA[<p><strong>shyzwbtk&#8230;</strong></p>
<p>shyzwbtk&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ??????? &#187; [Web] ????</title>
		<link>http://www.devtheweb.net/blog/2009/09/30/common-php-programming-mistakes/#comment-32</link>
		<dc:creator>??????? &#187; [Web] ????</dc:creator>
		<pubDate>Wed, 07 Oct 2009 11:36:39 +0000</pubDate>
		<guid isPermaLink="false">http://dev-the-web.com/blog/?p=199#comment-32</guid>
		<description>[...] Common PHP Programming Mistakes [...] </description>
		<content:encoded><![CDATA[<p>[...] Common PHP Programming Mistakes [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julius Beckmann</title>
		<link>http://www.devtheweb.net/blog/2009/09/30/common-php-programming-mistakes/#comment-31</link>
		<dc:creator>Julius Beckmann</dc:creator>
		<pubDate>Sat, 03 Oct 2009 17:02:50 +0000</pubDate>
		<guid isPermaLink="false">http://dev-the-web.com/blog/?p=199#comment-31</guid>
		<description>1. Performance is not relevant here. Sometimes its just stupid to use &quot; instead of &#039; and the other way round.
BTW: Wordpress fucked up your quotes :D

2. That is a real pitfall, only using (int) casting or using intval() saves the day!

3. Good to know, thanks.

4. In first place, if foreach gets at least 1 iteration, everything will be ok. Otherwise the array will be NULL which can lead to serious problems.

5. $_GET, $_POST and $_REQUEST are dangerous. Everybody should be trained to use them correctly!

6. mysql_real_escape_string is only necesary if you have strings, numbers and floats can be &quot;validated&quot; by simply casting them (int)$number;

7. A pitfall for beginners. Every devolper should use error_reporting(E_ALL); while developing.

8. strpos is the functions beginners need to learn that == is not ===. 

Thanks for this list, hope much people will read and use it!</description>
		<content:encoded><![CDATA[<p>1. Performance is not relevant here. Sometimes its just stupid to use &#8221; instead of &#8216; and the other way round.<br />
BTW: WordPress fucked up your quotes <img src='http://www.devtheweb.net/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>2. That is a real pitfall, only using (int) casting or using intval() saves the day!</p>
<p>3. Good to know, thanks.</p>
<p>4. In first place, if foreach gets at least 1 iteration, everything will be ok. Otherwise the array will be NULL which can lead to serious problems.</p>
<p>5. $_GET, $_POST and $_REQUEST are dangerous. Everybody should be trained to use them correctly!</p>
<p>6. mysql_real_escape_string is only necesary if you have strings, numbers and floats can be &#8220;validated&#8221; by simply casting them (int)$number;</p>
<p>7. A pitfall for beginners. Every devolper should use error_reporting(E_ALL); while developing.</p>
<p>8. strpos is the functions beginners need to learn that == is not ===. </p>
<p>Thanks for this list, hope much people will read and use it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Common PHP Programming Mistakes &#124; My Web Development Bookmarks</title>
		<link>http://www.devtheweb.net/blog/2009/09/30/common-php-programming-mistakes/#comment-30</link>
		<dc:creator>Common PHP Programming Mistakes &#124; My Web Development Bookmarks</dc:creator>
		<pubDate>Sat, 03 Oct 2009 08:14:31 +0000</pubDate>
		<guid isPermaLink="false">http://dev-the-web.com/blog/?p=199#comment-30</guid>
		<description>[...] See the article here: Common PHP Programming Mistakes [...] </description>
		<content:encoded><![CDATA[<p>[...] See the article here: Common PHP Programming Mistakes [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tweets that mention Common PHP Programming Mistakes :Dev-The-Web's Blog -- Topsy.com</title>
		<link>http://www.devtheweb.net/blog/2009/09/30/common-php-programming-mistakes/#comment-29</link>
		<dc:creator>Tweets that mention Common PHP Programming Mistakes :Dev-The-Web's Blog -- Topsy.com</dc:creator>
		<pubDate>Sat, 03 Oct 2009 07:39:47 +0000</pubDate>
		<guid isPermaLink="false">http://dev-the-web.com/blog/?p=199#comment-29</guid>
		<description>[...] This post was mentioned on Twitter by Rich and Abdelrahman Omran. Abdelrahman Omran said: Common PHP Programming Mistakes http://bit.ly/3XIBjw [...] </description>
		<content:encoded><![CDATA[<p>[...] This post was mentioned on Twitter by Rich and Abdelrahman Omran. Abdelrahman Omran said: Common PHP Programming Mistakes <a href="http://bit.ly/3XIBjw" rel="nofollow">http://bit.ly/3XIBjw</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Posts about Programming from google blogs as of October 1, 2009 &#171; tryfly.com</title>
		<link>http://www.devtheweb.net/blog/2009/09/30/common-php-programming-mistakes/#comment-28</link>
		<dc:creator>Posts about Programming from google blogs as of October 1, 2009 &#171; tryfly.com</dc:creator>
		<pubDate>Fri, 02 Oct 2009 00:03:56 +0000</pubDate>
		<guid isPermaLink="false">http://dev-the-web.com/blog/?p=199#comment-28</guid>
		<description>[...]  [...] </description>
		<content:encoded><![CDATA[<p>[...]  [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keith Casey</title>
		<link>http://www.devtheweb.net/blog/2009/09/30/common-php-programming-mistakes/#comment-27</link>
		<dc:creator>Keith Casey</dc:creator>
		<pubDate>Thu, 01 Oct 2009 20:14:52 +0000</pubDate>
		<guid isPermaLink="false">http://dev-the-web.com/blog/?p=199#comment-27</guid>
		<description>Good God, can #1 die yet?  Even in benchmarking, you&#039;re talking about microseconds of improvement...  so if you&#039;re rendering *thousands* of pages every given second, you *might* see it reach into the millisecond range.

I&#039;m not sure I see the problem with #4...

The nasty thing with #5 is not filtering input.  Never trust the user.  Nope, never.</description>
		<content:encoded><![CDATA[<p>Good God, can #1 die yet?  Even in benchmarking, you&#8217;re talking about microseconds of improvement&#8230;  so if you&#8217;re rendering *thousands* of pages every given second, you *might* see it reach into the millisecond range.</p>
<p>I&#8217;m not sure I see the problem with #4&#8230;</p>
<p>The nasty thing with #5 is not filtering input.  Never trust the user.  Nope, never.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mario</title>
		<link>http://www.devtheweb.net/blog/2009/09/30/common-php-programming-mistakes/#comment-26</link>
		<dc:creator>mario</dc:creator>
		<pubDate>Thu, 01 Oct 2009 18:32:08 +0000</pubDate>
		<guid isPermaLink="false">http://dev-the-web.com/blog/?p=199#comment-26</guid>
		<description>#1 is an idiotic recommendation and has been refuted many times. Double quoted strings are actually faster for common cases and with all recent PHP versions. Btw, the strings are decoded by the tokenizer, not by the parser.

#6 sounds as if it were written by a Wordpress user. String escaping is only used by amateur programmers. If you feel the need for it, you are doing something wrong.
Go google for &quot;parameterized SQL&quot;. Learn it. Use it.</description>
		<content:encoded><![CDATA[<p>#1 is an idiotic recommendation and has been refuted many times. Double quoted strings are actually faster for common cases and with all recent PHP versions. Btw, the strings are decoded by the tokenizer, not by the parser.</p>
<p>#6 sounds as if it were written by a WordPress user. String escaping is only used by amateur programmers. If you feel the need for it, you are doing something wrong.<br />
Go google for &#8220;parameterized SQL&#8221;. Learn it. Use it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.devtheweb.net/blog/2009/09/30/common-php-programming-mistakes/#comment-25</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Thu, 01 Oct 2009 18:21:19 +0000</pubDate>
		<guid isPermaLink="false">http://dev-the-web.com/blog/?p=199#comment-25</guid>
		<description>The single quotes argument really only holds up when you&#039;re benchmarking, and at that comparing 0.021 seconds versus 0.024 seconds [made that up but you get my point]...

I have an entire site which is echoed from &quot;&quot; strings, and that includes *all* html, and it runs super fast. Although, I almost always use single-quote strings for regexs. [I&#039;m rather tired of seeing this posted as a way to improve php performance, which is almost always hindered by mysql or other services [remote or local]].

Also, great point about #4... if anyone dares to turn on the strict warnings, php will not be a happy camper if you start push()ing an a null var. Plus, if that happens to be in a loop, it resets the var for you :-)</description>
		<content:encoded><![CDATA[<p>The single quotes argument really only holds up when you&#8217;re benchmarking, and at that comparing 0.021 seconds versus 0.024 seconds [made that up but you get my point]&#8230;</p>
<p>I have an entire site which is echoed from &#8220;&#8221; strings, and that includes *all* html, and it runs super fast. Although, I almost always use single-quote strings for regexs. [I'm rather tired of seeing this posted as a way to improve php performance, which is almost always hindered by mysql or other services [remote or local]].</p>
<p>Also, great point about #4&#8230; if anyone dares to turn on the strict warnings, php will not be a happy camper if you start push()ing an a null var. Plus, if that happens to be in a loop, it resets the var for you <img src='http://www.devtheweb.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

