svn: /phpdoc/en/trunk/reference/var/functions/ unset.xml
| From: | Justin Martin | Date: | Thu, 12 Jan 2012 05:23:03 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/var/functions/ unset.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-9421@lists.php.net to get a copy of this message | ||
frozenfire Thu, 12 Jan 2012 05:23:03 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=322117
Log:
Clarified highly-misleading (unset) casting example. Resolves bug #55164.
Bug: https://bugs.php.net/55164 (Analyzed)
Unclear/incorrect description of "casting to null"
Changed paths:
U phpdoc/en/trunk/reference/var/functions/unset.xml
Modified: phpdoc/en/trunk/reference/var/functions/unset.xml
===================================================================
--- phpdoc/en/trunk/reference/var/functions/unset.xml 2012-01-12 05:10:36 UTC (rev 322116)
+++ phpdoc/en/trunk/reference/var/functions/unset.xml 2012-01-12 05:23:03 UTC (rev 322117)
@@ -228,16 +228,30 @@
</programlisting>
</example>
<example>
- <title>Using (unset) casting</title>
+ <title>Using <literal>(unset)</literal> casting</title>
+ <para>
+ <literal>(unset)</literal> casting is often confused with the
+ <function>unset</function> function. <literal>(unset)</literal>
+ casting serves only as a <literal>NULL</literal>-type cast, for
+ completeness. It does not alter the variable it's casting.
+ </para>
<programlisting role="php">
<![CDATA[
<?php
$name = 'Felipe';
var_dump((unset) $name);
+var_dump($name);
?>
]]>
</programlisting>
+ &example.outputs;
+ <screen>
+<![CDATA[
+NULL
+string(6) "Felipe"
+]]>
+ </screen>
</example>
</para>
</refsect1>