mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Clarified highly-misleading (unset) casting example. Resolves bug #55164.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@322117 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
d508aa1de0
commit
c7c5b9cbe2
1 changed files with 15 additions and 1 deletions
|
@ -228,16 +228,30 @@ unset($foo1, $foo2, $foo3);
|
|||
</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>
|
||||
|
|
Loading…
Reference in a new issue