<?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: Triple Equal Operator and NULL in PHP</title>
	<atom:link href="http://www.dimuthu.org/blog/2008/10/31/triple-equal-operator-and-null-in-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dimuthu.org/blog/2008/10/31/triple-equal-operator-and-null-in-php/</link>
	<description>Waiting for your comments</description>
	<lastBuildDate>Fri, 03 Sep 2010 11:56:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: dimuthu</title>
		<link>http://www.dimuthu.org/blog/2008/10/31/triple-equal-operator-and-null-in-php/comment-page-1/#comment-708</link>
		<dc:creator>dimuthu</dc:creator>
		<pubDate>Tue, 04 Nov 2008 03:41:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.dimuthu.org/?p=564#comment-708</guid>
		<description>Thanks @Gromitt, 
That summarize the whole story.</description>
		<content:encoded><![CDATA[<p>Thanks @Gromitt,<br />
That summarize the whole story.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gromitt</title>
		<link>http://www.dimuthu.org/blog/2008/10/31/triple-equal-operator-and-null-in-php/comment-page-1/#comment-707</link>
		<dc:creator>Gromitt</dc:creator>
		<pubDate>Tue, 04 Nov 2008 03:35:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.dimuthu.org/?p=564#comment-707</guid>
		<description>Here is the global idea :

=== : IF &quot;types are the same&quot;, THEN IF &quot;values are the same&quot;, THEN return TRUE.

== : IF &quot;types are not the same&quot;, THEN re-cast &quot;right-hand operator&quot; into the same type as &quot;left-hand operator&quot;, THEN IF &quot;values are the same&quot;, THEN return TRUE.</description>
		<content:encoded><![CDATA[<p>Here is the global idea :</p>
<p>=== : IF &#8220;types are the same&#8221;, THEN IF &#8220;values are the same&#8221;, THEN return TRUE.</p>
<p>== : IF &#8220;types are not the same&#8221;, THEN re-cast &#8220;right-hand operator&#8221; into the same type as &#8220;left-hand operator&#8221;, THEN IF &#8220;values are the same&#8221;, THEN return TRUE.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dimuthu</title>
		<link>http://www.dimuthu.org/blog/2008/10/31/triple-equal-operator-and-null-in-php/comment-page-1/#comment-691</link>
		<dc:creator>dimuthu</dc:creator>
		<pubDate>Mon, 03 Nov 2008 14:10:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.dimuthu.org/?p=564#comment-691</guid>
		<description>Hi Ivan,
Amazingly you are right. I did a simple loop with 1000000 comparisons for both &#039;==&#039; and &#039;===&#039; with both simple types and class instances. &#039;===&#039; was the faster. Should digg in to the c code to see what s really happening there.

Thanks
Dimuthu</description>
		<content:encoded><![CDATA[<p>Hi Ivan,<br />
Amazingly you are right. I did a simple loop with 1000000 comparisons for both &#8216;==&#8217; and &#8216;===&#8217; with both simple types and class instances. &#8216;===&#8217; was the faster. Should digg in to the c code to see what s really happening there.</p>
<p>Thanks<br />
Dimuthu</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dimuthu</title>
		<link>http://www.dimuthu.org/blog/2008/10/31/triple-equal-operator-and-null-in-php/comment-page-1/#comment-689</link>
		<dc:creator>dimuthu</dc:creator>
		<pubDate>Mon, 03 Nov 2008 13:53:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.dimuthu.org/?p=564#comment-689</guid>
		<description>Hi Ivan,
I haven&#039;t check the execution time of &#039;==&#039;. I feel it is anyway speeder than &#039;===&#039; because it doesn&#039;t compare the type. Anyway Should do a test and confirm.

Thanks
Dimuthu</description>
		<content:encoded><![CDATA[<p>Hi Ivan,<br />
I haven&#8217;t check the execution time of &#8216;==&#8217;. I feel it is anyway speeder than &#8216;===&#8217; because it doesn&#8217;t compare the type. Anyway Should do a test and confirm.</p>
<p>Thanks<br />
Dimuthu</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ivan</title>
		<link>http://www.dimuthu.org/blog/2008/10/31/triple-equal-operator-and-null-in-php/comment-page-1/#comment-688</link>
		<dc:creator>Ivan</dc:creator>
		<pubDate>Mon, 03 Nov 2008 13:31:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.dimuthu.org/?p=564#comment-688</guid>
		<description>Never use &#039;==&#039;! It doesn&#039;t compare data type and it&#039;s slower!</description>
		<content:encoded><![CDATA[<p>Never use &#8216;==&#8217;! It doesn&#8217;t compare data type and it&#8217;s slower!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dimuthu</title>
		<link>http://www.dimuthu.org/blog/2008/10/31/triple-equal-operator-and-null-in-php/comment-page-1/#comment-665</link>
		<dc:creator>dimuthu</dc:creator>
		<pubDate>Sun, 02 Nov 2008 06:56:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.dimuthu.org/?p=564#comment-665</guid>
		<description>Hi Rubayeet,
I agree with you. Simply you have to use === and == according to the application. In fact there can be situation you don&#039;t really care about types (say you expect either string &#039;2&#039; or 2). In these situation you will be using &#039;==&#039;.</description>
		<content:encoded><![CDATA[<p>Hi Rubayeet,<br />
I agree with you. Simply you have to use === and == according to the application. In fact there can be situation you don&#8217;t really care about types (say you expect either string &#8217;2&#8242; or 2). In these situation you will be using &#8216;==&#8217;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rubayeet</title>
		<link>http://www.dimuthu.org/blog/2008/10/31/triple-equal-operator-and-null-in-php/comment-page-1/#comment-664</link>
		<dc:creator>Rubayeet</dc:creator>
		<pubDate>Sun, 02 Nov 2008 06:41:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.dimuthu.org/?p=564#comment-664</guid>
		<description>&#039;===&#039; is known as &#039;Strict Comparison Operator&#039;. It checks both the values and types of its operands. It is considered a good practice to use it instead of &#039;==&#039;. You may take a look at this post: 

http://rubayeet.wordpress.com/2008/04/29/a-simple-php-gotcha/</description>
		<content:encoded><![CDATA[<p>&#8216;===&#8217; is known as &#8216;Strict Comparison Operator&#8217;. It checks both the values and types of its operands. It is considered a good practice to use it instead of &#8216;==&#8217;. You may take a look at this post: </p>
<p><a href="http://rubayeet.wordpress.com/2008/04/29/a-simple-php-gotcha/" rel="nofollow">http://rubayeet.wordpress.com/2008/04/29/a-simple-php-gotcha/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dimuthu</title>
		<link>http://www.dimuthu.org/blog/2008/10/31/triple-equal-operator-and-null-in-php/comment-page-1/#comment-660</link>
		<dc:creator>dimuthu</dc:creator>
		<pubDate>Sun, 02 Nov 2008 03:45:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.dimuthu.org/?p=564#comment-660</guid>
		<description>yea. the is_null($foo) do the same job as $foo === NULL. Thanks for raising that.</description>
		<content:encoded><![CDATA[<p>yea. the is_null($foo) do the same job as $foo === NULL. Thanks for raising that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gromitt</title>
		<link>http://www.dimuthu.org/blog/2008/10/31/triple-equal-operator-and-null-in-php/comment-page-1/#comment-659</link>
		<dc:creator>Gromitt</dc:creator>
		<pubDate>Sun, 02 Nov 2008 03:10:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.dimuthu.org/?p=564#comment-659</guid>
		<description>For NULL comparisons, prefer the is_null($foo) built-in PHP function which makes probably more sense, as &quot;NULL&quot; is not really a value (nor a type), but the &quot;absence of a value&quot;.</description>
		<content:encoded><![CDATA[<p>For NULL comparisons, prefer the is_null($foo) built-in PHP function which makes probably more sense, as &#8220;NULL&#8221; is not really a value (nor a type), but the &#8220;absence of a value&#8221;.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
