<?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: Juggling time zones</title>
	<atom:link href="http://blog.chuckcerrillo.com/2009/09/juggling-time-zones/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.chuckcerrillo.com/2009/09/juggling-time-zones/</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 01 Jul 2010 14:42:56 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Hayden</title>
		<link>http://blog.chuckcerrillo.com/2009/09/juggling-time-zones/comment-page-1/#comment-75</link>
		<dc:creator>Hayden</dc:creator>
		<pubDate>Fri, 20 Nov 2009 01:49:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.chuckcerrillo.com/?p=100#comment-75</guid>
		<description>I wrote a similar blog on this subject but you nailed it here.</description>
		<content:encoded><![CDATA[<p>I wrote a similar blog on this subject but you nailed it here.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chuck</title>
		<link>http://blog.chuckcerrillo.com/2009/09/juggling-time-zones/comment-page-1/#comment-70</link>
		<dc:creator>Chuck</dc:creator>
		<pubDate>Mon, 02 Nov 2009 20:24:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.chuckcerrillo.com/?p=100#comment-70</guid>
		<description>sure</description>
		<content:encoded><![CDATA[<p>sure</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Polprav</title>
		<link>http://blog.chuckcerrillo.com/2009/09/juggling-time-zones/comment-page-1/#comment-69</link>
		<dc:creator>Polprav</dc:creator>
		<pubDate>Mon, 02 Nov 2009 20:21:16 +0000</pubDate>
		<guid isPermaLink="false">http://blog.chuckcerrillo.com/?p=100#comment-69</guid>
		<description>Hello from Russia!
Can I quote a post &quot;No teme&quot;  in your blog with the link to you?</description>
		<content:encoded><![CDATA[<p>Hello from Russia!<br />
Can I quote a post &#8220;No teme&#8221;  in your blog with the link to you?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nil a</title>
		<link>http://blog.chuckcerrillo.com/2009/09/juggling-time-zones/comment-page-1/#comment-23</link>
		<dc:creator>nil a</dc:creator>
		<pubDate>Mon, 07 Sep 2009 06:31:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.chuckcerrillo.com/?p=100#comment-23</guid>
		<description>oohhhh! clearer! nice nice!</description>
		<content:encoded><![CDATA[<p>oohhhh! clearer! nice nice!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chuck</title>
		<link>http://blog.chuckcerrillo.com/2009/09/juggling-time-zones/comment-page-1/#comment-21</link>
		<dc:creator>Chuck</dc:creator>
		<pubDate>Sun, 06 Sep 2009 07:07:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.chuckcerrillo.com/?p=100#comment-21</guid>
		<description>but if you instead used this:

if($value === TRUE)


only $value = TRUE; will evaluate as TRUE



Here&#039;s a practical example for that... if you are to perform string matching and you wanted to find the offset of the matched string (remember strcmp during highschool days?)

Say, we have this string:

$string = &quot;I would like to buy a hamburger&quot;;

...and you wanted to find... say... &quot;hamburger&quot;. We&#039;ll be using the strpos() function to get the offset: http://us3.php.net/manual/en/function.strpos.php
Note: Returns the position as an integer. If needle is not found, strpos() will return boolean FALSE.


so if you do this:

$string = &quot;I would like to buy a hamburger&quot;;
if( strpos($string,&#039;hamburger&#039;) == FALSE )
echo &#039;There is no hamburger...&#039;;
else
echo &#039;We found a hamburger!&#039;;



This will display &quot;We found a hamburger!&quot; because the string &#039;hamburger&#039; is found at position 22. But what if we had this string instead?

$string = &quot;hamburger and fries is a good combination&quot;;

Using the same condition, this will display &quot;Theere is no hamburger...&quot;. Even though we can find it at position 0 of $string. Remember type juggling. 0 = FALSE.

so if you do it this way instead

$string = &quot;hamburger and fries is a good combination&quot;;
if( strpos($string,&#039;hamburger&#039;) === FALSE )
echo &#039;There is no hamburger...&#039;;
else
echo &#039;We found a hamburger!&#039;;


It would only evaluate as FALSE when strpos does not find the string.</description>
		<content:encoded><![CDATA[<p>but if you instead used this:</p>
<p>if($value === TRUE)</p>
<p>only $value = TRUE; will evaluate as TRUE</p>
<p>Here&#8217;s a practical example for that&#8230; if you are to perform string matching and you wanted to find the offset of the matched string (remember strcmp during highschool days?)</p>
<p>Say, we have this string:</p>
<p>$string = &#8220;I would like to buy a hamburger&#8221;;</p>
<p>&#8230;and you wanted to find&#8230; say&#8230; &#8220;hamburger&#8221;. We&#8217;ll be using the strpos() function to get the offset: <a href="http://us3.php.net/manual/en/function.strpos.php" rel="nofollow">http://us3.php.net/manual/en/function.strpos.php</a><br />
Note: Returns the position as an integer. If needle is not found, strpos() will return boolean FALSE.</p>
<p>so if you do this:</p>
<p>$string = &#8220;I would like to buy a hamburger&#8221;;<br />
if( strpos($string,&#8217;hamburger&#8217;) == FALSE )<br />
echo &#8216;There is no hamburger&#8230;&#8217;;<br />
else<br />
echo &#8216;We found a hamburger!&#8217;;</p>
<p>This will display &#8220;We found a hamburger!&#8221; because the string &#8216;hamburger&#8217; is found at position 22. But what if we had this string instead?</p>
<p>$string = &#8220;hamburger and fries is a good combination&#8221;;</p>
<p>Using the same condition, this will display &#8220;Theere is no hamburger&#8230;&#8221;. Even though we can find it at position 0 of $string. Remember type juggling. 0 = FALSE.</p>
<p>so if you do it this way instead</p>
<p>$string = &#8220;hamburger and fries is a good combination&#8221;;<br />
if( strpos($string,&#8217;hamburger&#8217;) === FALSE )<br />
echo &#8216;There is no hamburger&#8230;&#8217;;<br />
else<br />
echo &#8216;We found a hamburger!&#8217;;</p>
<p>It would only evaluate as FALSE when strpos does not find the string.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chuck</title>
		<link>http://blog.chuckcerrillo.com/2009/09/juggling-time-zones/comment-page-1/#comment-20</link>
		<dc:creator>Chuck</dc:creator>
		<pubDate>Sun, 06 Sep 2009 06:57:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.chuckcerrillo.com/?p=100#comment-20</guid>
		<description>&lt;a href=&quot;#comment-19&quot; rel=&quot;nofollow&quot;&gt;@nil acuna &lt;/a&gt; 

We call that &quot;type juggling&quot; in PHP, here&#039;s a reference:
http://us3.php.net/manual/en/language.types.type-juggling.php

The variables are treated contextually, e.g. if you add &quot;100&quot; (a string) to 100 (an integer), you get 200 (integer). But if you concatenate &quot;100&quot; and 100, you get &quot;100100&quot; (string).

Type casting can also be done if you&#039;re used to it.

&lt;blockquote cite=&quot;#commentbody-18&quot;&gt;
&lt;strong&gt;&lt;a href=&quot;#comment-18&quot; rel=&quot;nofollow&quot;&gt;nil acuna&lt;/a&gt; :&lt;/strong&gt;
&lt;P&gt;say $value = 1 + 1 ; would imply $value is a number.  then if ($value == FALSE) will not behave as expected. php is still very very voodoo to me, but i’m slowly up picking interest!&lt;/P&gt;
&lt;/blockquote&gt;


if($value == TRUE) 

- is the same as writing if($value)

this means $value must contain any value which is not the equivalent of FALSE, meaning, all the following values will cause that condition to evaluate as true:

$value = 1; // integer
$value = &#039;chuck&#039;; // string
$value = TRUE; // boolean
$value = &#039;chuck&#039; . &#039; cerrillo&#039;; // string concatenation
$value = 100 + 1; // integer

while all of the following will evaluate as FALSE:

$value = FALSE; // boolean FALSE
$value = 0; // 0 = FALSE
$value = &#039;0&#039;; // &#039;0&#039; =&gt; 0 = FALSE
$value = NULL; // since there&#039;s no value to check, it&#039;s FALSE</description>
		<content:encoded><![CDATA[<p><a href="#comment-19" rel="nofollow">@nil acuna </a> </p>
<p>We call that &#8220;type juggling&#8221; in PHP, here&#8217;s a reference:<br />
<a href="http://us3.php.net/manual/en/language.types.type-juggling.php" rel="nofollow">http://us3.php.net/manual/en/language.types.type-juggling.php</a></p>
<p>The variables are treated contextually, e.g. if you add &#8220;100&#8243; (a string) to 100 (an integer), you get 200 (integer). But if you concatenate &#8220;100&#8243; and 100, you get &#8220;100100&#8243; (string).</p>
<p>Type casting can also be done if you&#8217;re used to it.</p>
<blockquote cite="#commentbody-18"><p>
<strong><a href="#comment-18" rel="nofollow">nil acuna</a> :</strong></p>
<p>say $value = 1 + 1 ; would imply $value is a number.  then if ($value == FALSE) will not behave as expected. php is still very very voodoo to me, but i’m slowly up picking interest!</p>
</blockquote>
<p>if($value == TRUE) </p>
<p>- is the same as writing if($value)</p>
<p>this means $value must contain any value which is not the equivalent of FALSE, meaning, all the following values will cause that condition to evaluate as true:</p>
<p>$value = 1; // integer<br />
$value = &#8216;chuck&#8217;; // string<br />
$value = TRUE; // boolean<br />
$value = &#8216;chuck&#8217; . &#8216; cerrillo&#8217;; // string concatenation<br />
$value = 100 + 1; // integer</p>
<p>while all of the following will evaluate as FALSE:</p>
<p>$value = FALSE; // boolean FALSE<br />
$value = 0; // 0 = FALSE<br />
$value = &#8216;0&#8242;; // &#8216;0&#8242; => 0 = FALSE<br />
$value = NULL; // since there&#8217;s no value to check, it&#8217;s FALSE</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nil acuna</title>
		<link>http://blog.chuckcerrillo.com/2009/09/juggling-time-zones/comment-page-1/#comment-19</link>
		<dc:creator>nil acuna</dc:creator>
		<pubDate>Sun, 06 Sep 2009 06:39:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.chuckcerrillo.com/?p=100#comment-19</guid>
		<description>err s/being being/being referenced/</description>
		<content:encoded><![CDATA[<p>err s/being being/being referenced/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nil acuna</title>
		<link>http://blog.chuckcerrillo.com/2009/09/juggling-time-zones/comment-page-1/#comment-18</link>
		<dc:creator>nil acuna</dc:creator>
		<pubDate>Sun, 06 Sep 2009 06:36:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.chuckcerrillo.com/?p=100#comment-18</guid>
		<description>nifty! in the former if() statement, would it mean that FALSE is being promoted to, say, an &quot;int&quot; type as in C? i didn&#039;t see any type declaration for $value so it must mean that php must have some sort of auto variable type assignment ala PERL. would it mean that the first php statement that references $value also binds it to the type being being by the statement and that succeeding references to $value will throw type errors? 

say $value = 1 + 1 ; would imply $value is a number.  then if ($value == FALSE) will not behave as expected. php is still very very voodoo to me, but i&#039;m slowly up picking interest!</description>
		<content:encoded><![CDATA[<p>nifty! in the former if() statement, would it mean that FALSE is being promoted to, say, an &#8220;int&#8221; type as in C? i didn&#8217;t see any type declaration for $value so it must mean that php must have some sort of auto variable type assignment ala PERL. would it mean that the first php statement that references $value also binds it to the type being being by the statement and that succeeding references to $value will throw type errors? </p>
<p>say $value = 1 + 1 ; would imply $value is a number.  then if ($value == FALSE) will not behave as expected. php is still very very voodoo to me, but i&#8217;m slowly up picking interest!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chuck</title>
		<link>http://blog.chuckcerrillo.com/2009/09/juggling-time-zones/comment-page-1/#comment-17</link>
		<dc:creator>Chuck</dc:creator>
		<pubDate>Sat, 05 Sep 2009 07:22:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.chuckcerrillo.com/?p=100#comment-17</guid>
		<description>the equal signs is a special kind of comparison, which means &quot;must be equal to and must be of the same data type&quot;

because PHP has data type juggling, which means if:
$value = 0;

this means that:

if($value == FALSE) will evaluate as TRUE, since 0 is also equal to FALSE,

but if($value === FALSE) will evaluate to FALSE because 0 is not a boolean value</description>
		<content:encoded><![CDATA[<p>the equal signs is a special kind of comparison, which means &#8220;must be equal to and must be of the same data type&#8221;</p>
<p>because PHP has data type juggling, which means if:<br />
$value = 0;</p>
<p>this means that:</p>
<p>if($value == FALSE) will evaluate as TRUE, since 0 is also equal to FALSE,</p>
<p>but if($value === FALSE) will evaluate to FALSE because 0 is not a boolean value</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chuck</title>
		<link>http://blog.chuckcerrillo.com/2009/09/juggling-time-zones/comment-page-1/#comment-16</link>
		<dc:creator>Chuck</dc:creator>
		<pubDate>Sat, 05 Sep 2009 07:18:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.chuckcerrillo.com/?p=100#comment-16</guid>
		<description>yep, that&#039;s ternary operation</description>
		<content:encoded><![CDATA[<p>yep, that&#8217;s ternary operation</p>
]]></content:encoded>
	</item>
</channel>
</rss>
