<?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: PHP Variables: The Ultimate Guide</title>
	<atom:link href="http://sixrevisions.com/web-development/php-variables-the-ultimate-guide/feed/" rel="self" type="application/rss+xml" />
	<link>http://sixrevisions.com/web-development/php-variables-the-ultimate-guide/</link>
	<description></description>
	<lastBuildDate>Fri, 24 May 2013 13:37:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
	<item>
		<title>By: issam</title>
		<link>http://sixrevisions.com/web-development/php-variables-the-ultimate-guide/#comment-102908</link>
		<dc:creator>issam</dc:creator>
		<pubDate>Mon, 30 May 2011 17:33:17 +0000</pubDate>
		<guid isPermaLink="false">http://sixrevisions.com/?p=4041#comment-102908</guid>
		<description>im new to php and i have to say that its a very ugly language .... compare it to c#, java or even C its an ugly language ... the main reason for this is that every variable must start with $, it just make the code ugly and hard to follow and read ... i wonder if there a solution to this $ problem</description>
		<content:encoded><![CDATA[<p>im new to php and i have to say that its a very ugly language &#8230;. compare it to c#, java or even C its an ugly language &#8230; the main reason for this is that every variable must start with $, it just make the code ugly and hard to follow and read &#8230; i wonder if there a solution to this $ problem</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shoffy</title>
		<link>http://sixrevisions.com/web-development/php-variables-the-ultimate-guide/#comment-99648</link>
		<dc:creator>Shoffy</dc:creator>
		<pubDate>Tue, 03 May 2011 00:06:17 +0000</pubDate>
		<guid isPermaLink="false">http://sixrevisions.com/?p=4041#comment-99648</guid>
		<description>I&#039;m trying to do this and the $$ trick doesn&#039;t seem to be doing it.

$_SESSION[&#039;ip&#039;] = &#039;127.0.0.1&#039;;
$var = &#039;ip&#039;;

echo $_SESSION[$$var]; // echoes nothing
echo $_SESSION[&#039;ip&#039;]; // echoes 127.0.0.1

help?</description>
		<content:encoded><![CDATA[<p>I&#8217;m trying to do this and the $$ trick doesn&#8217;t seem to be doing it.</p>
<p>$_SESSION['ip'] = &#8217;127.0.0.1&#8242;;<br />
$var = &#8216;ip&#8217;;</p>
<p>echo $_SESSION[$$var]; // echoes nothing<br />
echo $_SESSION['ip']; // echoes 127.0.0.1</p>
<p>help?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shadows</title>
		<link>http://sixrevisions.com/web-development/php-variables-the-ultimate-guide/#comment-96590</link>
		<dc:creator>shadows</dc:creator>
		<pubDate>Tue, 05 Apr 2011 13:12:03 +0000</pubDate>
		<guid isPermaLink="false">http://sixrevisions.com/?p=4041#comment-96590</guid>
		<description>good articel :D</description>
		<content:encoded><![CDATA[<p>good articel :D</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vistor030897u</title>
		<link>http://sixrevisions.com/web-development/php-variables-the-ultimate-guide/#comment-93077</link>
		<dc:creator>vistor030897u</dc:creator>
		<pubDate>Mon, 28 Feb 2011 04:45:23 +0000</pubDate>
		<guid isPermaLink="false">http://sixrevisions.com/?p=4041#comment-93077</guid>
		<description>well explained and thanks much (excuse my english) ^_^</description>
		<content:encoded><![CDATA[<p>well explained and thanks much (excuse my english) ^_^</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Neil H</title>
		<link>http://sixrevisions.com/web-development/php-variables-the-ultimate-guide/#comment-81918</link>
		<dc:creator>Neil H</dc:creator>
		<pubDate>Mon, 15 Nov 2010 03:27:52 +0000</pubDate>
		<guid isPermaLink="false">http://sixrevisions.com/?p=4041#comment-81918</guid>
		<description>This is a great tutorial. For the record, I also really appreciate Dajve&#039;s clarity in explaining the difference between unset()  and $somevar = null;

While it will be some time before the distinction carries much weight with my studies, .01% worth of ambiguity now could turn into a substantial habitual error for me later on.

Thanks Elias (and Dajve).</description>
		<content:encoded><![CDATA[<p>This is a great tutorial. For the record, I also really appreciate Dajve&#8217;s clarity in explaining the difference between unset()  and $somevar = null;</p>
<p>While it will be some time before the distinction carries much weight with my studies, .01% worth of ambiguity now could turn into a substantial habitual error for me later on.</p>
<p>Thanks Elias (and Dajve).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kushal</title>
		<link>http://sixrevisions.com/web-development/php-variables-the-ultimate-guide/#comment-79010</link>
		<dc:creator>Kushal</dc:creator>
		<pubDate>Tue, 19 Oct 2010 09:35:44 +0000</pubDate>
		<guid isPermaLink="false">http://sixrevisions.com/?p=4041#comment-79010</guid>
		<description>Good article... this is first time i heared about var_dump()..
Expecting more article like this...</description>
		<content:encoded><![CDATA[<p>Good article&#8230; this is first time i heared about var_dump()..<br />
Expecting more article like this&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: achmatim</title>
		<link>http://sixrevisions.com/web-development/php-variables-the-ultimate-guide/#comment-77486</link>
		<dc:creator>achmatim</dc:creator>
		<pubDate>Wed, 29 Sep 2010 16:43:59 +0000</pubDate>
		<guid isPermaLink="false">http://sixrevisions.com/?p=4041#comment-77486</guid>
		<description>Sir, how about string literal with single quote (&#039;) and double quote (&quot;). Is it different..? Some people says that single quote is more faster than double quote.</description>
		<content:encoded><![CDATA[<p>Sir, how about string literal with single quote (&#8216;) and double quote (&#8220;). Is it different..? Some people says that single quote is more faster than double quote.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dajve</title>
		<link>http://sixrevisions.com/web-development/php-variables-the-ultimate-guide/#comment-77059</link>
		<dc:creator>Dajve</dc:creator>
		<pubDate>Fri, 24 Sep 2010 10:40:30 +0000</pubDate>
		<guid isPermaLink="false">http://sixrevisions.com/?p=4041#comment-77059</guid>
		<description>@Elias

&gt; @Dajve Working with references is also something which requires real life examples to make the user aware of its use.

I understand that working with references is not something to go into in this guide, it was just to illustrate the fact that there is a real difference between a variable being unset and being set to null. My point is simply that stating 
&quot;// The $new_items variable doesn’t exist now
$new_items = null;&quot;
and
&quot;unset() is a PHP function that is the same as doing $player_name = null;&quot;
is inaccurate and misleading, especially for a beginner who may be encountering this for the first time.

&gt; Your ‘it is just null’ statement makes sense, but what about undeclared variables, they are null too? They’re even identical according to ===.
Undeclared variables aren&#039;t null but they do evaluate to null, hence the results are identical; the fact that PHP will trigger an &quot;undefined variable&quot; notice shows that there is a problem with the statement. Also, the existence of both is_null() and isset() functions shows the two types should be dealt with discretely.

Teaching a beginner that this is a valid method of working with variables is, in my opinion, somewhat irresponsible. For example, a developer who disregards the undefined variable notice because he&#039;s grown accustomed to it appearing when working with null values is going to have a much harder time troubleshooting should he make a typo in a variable name becuase he&#039;s already disregarding that message.

As I say, I do think this is a useful primer for beginners, but there is an important distinction between something which exists and something which is null. For an article geared towards this level of developer, it&#039;s enough to make the reader aware of this fact without going into details; the problem I had is that you explicitly state the opposite on two occasions.

To give a real world example, it&#039;s the difference between having an empty cup and not having a cup at all. Most of the time you&#039;re concerned with the contents of the cup, which evaluate to the same thing (neither the empty nor non-existent cup contain anything). In the future, though, believing that there is no difference between the non-existant (unset) and empty (null) cups because that&#039;s what you were taught can lead to a horrible mess when you try to pour water into something that isn&#039;t there.
OK, so that&#039;s a slightly silly analogy but my point stands: despite the fact that, in most situations, you&#039;re more concerned by the fact you have no coffee rather than whether there is a cup there or not, there is still a difference between the two states.

&gt; See the ‘Data Type Switching’ where the user is warned for the expensivity of type switching. I could and probably should have included your point though.

Re: the difference between (unset)$foo and unset($foo)? That was more an incidental point about the quirkiness of PHP - to be honest, I can&#039;t understand the inclusion of an (unset) typecast, especially one that works differently to the unset() function, so I never use it. But that&#039;s a separate discussion - just thought it was the kind of point that belonged in the comments for those of us who read this far =o)

Anyway, that turned out longer than I expected! Don&#039;t think I&#039;m having a pop at what is a good article overall, I was just burned by incorrect statements of fact when I was starting out and know the difficulties trying to troubleshoot with false assumptions.

Dajve</description>
		<content:encoded><![CDATA[<p>@Elias</p>
<p>&gt; @Dajve Working with references is also something which requires real life examples to make the user aware of its use.</p>
<p>I understand that working with references is not something to go into in this guide, it was just to illustrate the fact that there is a real difference between a variable being unset and being set to null. My point is simply that stating<br />
&#8220;// The $new_items variable doesn’t exist now<br />
$new_items = null;&#8221;<br />
and<br />
&#8220;unset() is a PHP function that is the same as doing $player_name = null;&#8221;<br />
is inaccurate and misleading, especially for a beginner who may be encountering this for the first time.</p>
<p>&gt; Your ‘it is just null’ statement makes sense, but what about undeclared variables, they are null too? They’re even identical according to ===.<br />
Undeclared variables aren&#8217;t null but they do evaluate to null, hence the results are identical; the fact that PHP will trigger an &#8220;undefined variable&#8221; notice shows that there is a problem with the statement. Also, the existence of both is_null() and isset() functions shows the two types should be dealt with discretely.</p>
<p>Teaching a beginner that this is a valid method of working with variables is, in my opinion, somewhat irresponsible. For example, a developer who disregards the undefined variable notice because he&#8217;s grown accustomed to it appearing when working with null values is going to have a much harder time troubleshooting should he make a typo in a variable name becuase he&#8217;s already disregarding that message.</p>
<p>As I say, I do think this is a useful primer for beginners, but there is an important distinction between something which exists and something which is null. For an article geared towards this level of developer, it&#8217;s enough to make the reader aware of this fact without going into details; the problem I had is that you explicitly state the opposite on two occasions.</p>
<p>To give a real world example, it&#8217;s the difference between having an empty cup and not having a cup at all. Most of the time you&#8217;re concerned with the contents of the cup, which evaluate to the same thing (neither the empty nor non-existent cup contain anything). In the future, though, believing that there is no difference between the non-existant (unset) and empty (null) cups because that&#8217;s what you were taught can lead to a horrible mess when you try to pour water into something that isn&#8217;t there.<br />
OK, so that&#8217;s a slightly silly analogy but my point stands: despite the fact that, in most situations, you&#8217;re more concerned by the fact you have no coffee rather than whether there is a cup there or not, there is still a difference between the two states.</p>
<p>&gt; See the ‘Data Type Switching’ where the user is warned for the expensivity of type switching. I could and probably should have included your point though.</p>
<p>Re: the difference between (unset)$foo and unset($foo)? That was more an incidental point about the quirkiness of PHP &#8211; to be honest, I can&#8217;t understand the inclusion of an (unset) typecast, especially one that works differently to the unset() function, so I never use it. But that&#8217;s a separate discussion &#8211; just thought it was the kind of point that belonged in the comments for those of us who read this far =o)</p>
<p>Anyway, that turned out longer than I expected! Don&#8217;t think I&#8217;m having a pop at what is a good article overall, I was just burned by incorrect statements of fact when I was starting out and know the difficulties trying to troubleshoot with false assumptions.</p>
<p>Dajve</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mittal Patel</title>
		<link>http://sixrevisions.com/web-development/php-variables-the-ultimate-guide/#comment-76758</link>
		<dc:creator>Mittal Patel</dc:creator>
		<pubDate>Wed, 22 Sep 2010 05:54:38 +0000</pubDate>
		<guid isPermaLink="false">http://sixrevisions.com/?p=4041#comment-76758</guid>
		<description>Very nice article for beginners !
Though I knew almost everything of it already but enjoyed reading this. :-)</description>
		<content:encoded><![CDATA[<p>Very nice article for beginners !<br />
Though I knew almost everything of it already but enjoyed reading this. :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ankur</title>
		<link>http://sixrevisions.com/web-development/php-variables-the-ultimate-guide/#comment-76750</link>
		<dc:creator>Ankur</dc:creator>
		<pubDate>Wed, 22 Sep 2010 02:55:18 +0000</pubDate>
		<guid isPermaLink="false">http://sixrevisions.com/?p=4041#comment-76750</guid>
		<description>thanks JT, i was wondering how PHP would know if 0111001 isnt just 111,001 in decimal because the convention of starting with a 0 for octal wasn&#039;t familiar to me.</description>
		<content:encoded><![CDATA[<p>thanks JT, i was wondering how PHP would know if 0111001 isnt just 111,001 in decimal because the convention of starting with a 0 for octal wasn&#8217;t familiar to me.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
