downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

Source of: /manual/en/language.types.null.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once
dirname(__FILE__) ."/toc/language.types.inc";
$setup = array (
 
'home' =>
  array (
   
0 => 'index.php',
   
1 => 'PHP Manual',
  ),
 
'head' =>
  array (
   
0 => 'UTF-8',
   
1 => 'en',
  ),
 
'this' =>
  array (
   
0 => 'language.types.null.php',
   
1 => 'NULL',
  ),
 
'up' =>
  array (
   
0 => 'language.types.php',
   
1 => 'Types',
  ),
 
'prev' =>
  array (
   
0 => 'language.types.resource.php',
   
1 => 'Resources',
  ),
 
'next' =>
  array (
   
0 => 'language.pseudo-types.php',
   
1 => 'Pseudo-types and variables used in this documentation',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="language.types.null" class="sect1">
 <h2 class="title">NULL</h2>
 
 <p class="para">
  The special <b><tt class="constant">NULL</tt></b> value represents a variable with no value. <b><tt class="constant">NULL</tt></b> is the
  only possible value of type <a href="language.types.null.php" class="type NULL">NULL</a>.
 </p>

 <blockquote><p><b class="note">Note</b>:
  <span class="simpara">
   The <a href="language.types.null.php" class="type null">null</a> type was introduced in PHP 4.
  </span>
 </p></blockquote>

 <p class="para">
  A variable is considered to be <a href="language.types.null.php" class="type null">null</a> if:
 </p>

 <ul class="itemizedlist">
  <li class="listitem">
   <p class="para">
    it has been assigned the constant <b><tt class="constant">NULL</tt></b>.
   </p>
  </li>
  <li class="listitem">
   <p class="para">
    it has not been set to any value yet.
   </p>
  </li>
  <li class="listitem">
   <p class="para">
    it has been <a href="function.unset.php" class="function">unset()</a>.
   </p>
  </li>
 </ul>
 
 <div id="language.types.null.syntax" class="sect2">
  <h3 class="title">Syntax</h3>

  <p class="para">
   There is only one value of type <a href="language.types.null.php" class="type null">null</a>, and that is the
   case-insensitive keyword <b><tt class="constant">NULL</tt></b>.
  </p>

  <div class="informalexample">
   <div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$var&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">NULL</span><span style="color: #007700">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
   </div>

  </div>

  <p class="para">
   See also the functions <a href="function.is-null.php" class="function">is_null()</a> and
   <a href="function.unset.php" class="function">unset()</a>.
  </p>

 </div>

 <div id="language.types.null.casting" class="sect2">
  <h3 class="title">Casting to <i>NULL</i></h3>
 
  <p class="para">
   Casting a variable to <a href="language.types.null.php" class="type null">null</a> will remove the variable
   and unset its value.
  </p>

 </div>

</div><?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites