php-doc-en/language/types/null.xml
Andrey Andreev 028513e94b Document PHP 7.2 deprecations as the result of https://wiki.php.net/rfc/deprecations_php_7_2
Also, simplify the first paragraph of 'Traditional assertions' in assert() docs

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@342126 c90b9560-bf6c-de11-be94-00142212c4b1
2017-03-14 11:30:59 +00:00

94 lines
1.9 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<sect1 xml:id="language.types.null">
<title>NULL</title>
<para>
The special &null; value represents a variable with no value. &null; is the
only possible value of type <type>null</type>.
</para>
<para>
A variable is considered to be <type>null</type> if:
</para>
<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>
<sect2 xml:id="language.types.null.syntax">
<title>Syntax</title>
<para>
There is only one value of type <type>null</type>, and that is the
case-insensitive constant &null;.
</para>
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
$var = NULL;
?>
]]>
</programlisting>
</informalexample>
<para>
See also the functions <function>is_null</function> and
<function>unset</function>.
</para>
</sect2>
<sect2 xml:id="language.types.null.casting">
<title>Casting to &null;</title>
<para>
&warn.deprecated.feature-7-2-0;
</para>
<para>
Casting a variable to <type>null</type> using <literal>(unset) $var</literal>
will <emphasis>not</emphasis> remove the variable or unset its value.
It will only return a &null; value.
</para>
</sect2>
</sect1>
<!-- 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
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
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
-->