note 92666 deleted from language.types.null by danbrown
| From: | danbrown@php.net | Date: | Mon, 14 Sep 2009 01:59:15 +0000 |
| Subject: | note 92666 deleted from language.types.null by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-160523@lists.php.net to get a copy of this message | ||
Note Submitter: anton dot clarke at variantfuture dot co
----
As the documentation does not mention it and just in case you were wondering:
<?php
$a = null;
$b = NULL;
if(is_null($a)) echo 'is_null() is true where $a=null<br/>';
if($a===null) echo '$a IS EXACTLY null <br/>';
if($a===NULL) echo '$a IS EXACTLY NULL <br/>';
if(null === NULL) echo 'null === NULL<br/>';
if(null == NULL) echo 'null == NULL<br/>';
if($a === $b) echo '$a === $b<br/>';
if($a == $b) echo '$a == $b<br/>';
?>
as expected produces the following in 5.2.9.
is_null() is true where $a=null
IS EXACTLY null
IS EXACTLY NULL
null === NULL
null == NULL
$a === $b
$a == $b
Obvious really, but worth checking when you consider the potential issues.
Also by the same type of test:
true === TRUE and false === FALSE.