<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rants of a mobile dev &#187; Php</title>
	<atom:link href="http://blog.smartcube.co.za/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.smartcube.co.za</link>
	<description>Mobile developer ranting about mobile stuff</description>
	<lastBuildDate>Sun, 02 May 2010 20:58:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Pigs Can Fly</title>
		<link>http://blog.smartcube.co.za/2008/11/12/pigs-can-fly/</link>
		<comments>http://blog.smartcube.co.za/2008/11/12/pigs-can-fly/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 19:17:29 +0000</pubDate>
		<dc:creator>drubin</dc:creator>
				<category><![CDATA[Programing]]></category>
		<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">http://blog.smartcube.co.za/?p=37</guid>
		<description><![CDATA[Php is so loosely typed that true==false in php. $a = &#8216;foo&#8217;; $b = 0; if ( $a == true &#38;&#38; $b == false &#38;&#38; $a == $b ) { echo &#8220;Pigs Can Fly&#8221;; } Produces &#8220;Pigs Can Fly&#8221;. Strings are considered true if they are not empty or null. so &#8216;foo&#8217;==true would be true==true [...]]]></description>
			<content:encoded><![CDATA[<p>Php is so loosely typed that true==false in php.</p>
<blockquote><p>
$a = &#8216;foo&#8217;;<br />
$b = 0;<br />
if ( $a == true &amp;&amp; $b == false &amp;&amp; $a == $b ) {<br />
echo &#8220;Pigs Can Fly&#8221;;<br />
}</p></blockquote>
<p>Produces  &#8220;Pigs Can Fly&#8221;.<br />
Strings are considered true if they are not empty or null. so &#8216;foo&#8217;==true would be true==true ie true<br />
Numbers are considered false if they are 0. so 0 == false is false == false ie true<br />
As for the last point this still fascinates me.<br />
Because there are no numbers in variable $a, is set to 0, therefore int 0 == int 0.</p>
<p><a href="http://stuweb.jcu.edu/ptagliamonte11/">Source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.smartcube.co.za/2008/11/12/pigs-can-fly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
