2008-02-14 19:57:17 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2009-07-11 06:17:58 +00:00
|
|
|
<!-- $Revision$ -->
|
2008-02-14 20:50:33 +00:00
|
|
|
<sect1 xml:id="language.types.null">
|
|
|
|
<title>NULL</title>
|
|
|
|
|
|
|
|
<para>
|
2008-02-21 18:43:17 +00:00
|
|
|
The special &null; value represents a variable with no value. &null; is the
|
2012-09-03 10:36:09 +00:00
|
|
|
only possible value of type <type>null</type>.
|
2008-02-14 20:50:33 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2008-02-21 18:43:17 +00:00
|
|
|
A variable is considered to be <type>null</type> if:
|
2008-02-14 20:50:33 +00:00
|
|
|
</para>
|
2008-02-18 22:32:54 +00:00
|
|
|
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
it has been assigned the constant &null;.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
it has not been set to any value yet.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
it has been <function>unset</function>.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
2008-02-14 20:50:33 +00:00
|
|
|
|
|
|
|
<sect2 xml:id="language.types.null.syntax">
|
|
|
|
<title>Syntax</title>
|
|
|
|
|
|
|
|
<para>
|
2008-02-21 18:43:17 +00:00
|
|
|
There is only one value of type <type>null</type>, and that is the
|
2012-01-27 15:46:29 +00:00
|
|
|
case-insensitive constant &null;.
|
2008-02-18 22:32:54 +00:00
|
|
|
</para>
|
2008-02-14 20:50:33 +00:00
|
|
|
|
2008-02-18 22:32:54 +00:00
|
|
|
<informalexample>
|
|
|
|
<programlisting role="php">
|
2008-02-14 19:57:17 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
$var = NULL;
|
|
|
|
?>
|
|
|
|
]]>
|
2008-02-18 22:32:54 +00:00
|
|
|
</programlisting>
|
|
|
|
</informalexample>
|
2008-02-14 20:50:33 +00:00
|
|
|
|
|
|
|
<para>
|
2008-02-21 18:43:17 +00:00
|
|
|
See also the functions <function>is_null</function> and
|
|
|
|
<function>unset</function>.
|
2008-02-14 20:50:33 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect2>
|
2012-01-27 16:09:45 +00:00
|
|
|
|
|
|
|
<sect2 xml:id="language.types.null.casting">
|
2012-09-03 10:36:09 +00:00
|
|
|
<title>Casting to &null;</title>
|
2012-01-27 16:09:45 +00:00
|
|
|
|
2017-03-14 11:30:59 +00:00
|
|
|
<para>
|
|
|
|
&warn.deprecated.feature-7-2-0;
|
|
|
|
</para>
|
|
|
|
|
2012-01-27 16:09:45 +00:00
|
|
|
<para>
|
2012-04-15 13:18:17 +00:00
|
|
|
Casting a variable to <type>null</type> using <literal>(unset) $var</literal>
|
2012-01-27 16:09:45 +00:00
|
|
|
will <emphasis>not</emphasis> remove the variable or unset its value.
|
|
|
|
It will only return a &null; value.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect2>
|
2008-08-12 22:06:41 +00:00
|
|
|
|
2008-02-14 20:50:33 +00:00
|
|
|
</sect1>
|
2008-02-14 19:57:17 +00:00
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
sgml-parent-document:nil
|
2009-09-25 07:04:39 +00:00
|
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
2008-02-14 19:57:17 +00:00
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|