note 92666 added to language.types.null
| From: | antondotclarkeatvariantfuturedotco at osu1 dot php dot net | Date: | Mon, 03 Aug 2009 10:37:16 +0000 |
| Subject: | note 92666 added to language.types.null | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-159026@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 209.41.74.194
Probable Submitter: 80.3.156.124
----
Manual Page -- http://www.php.net/manual/en/language.types.null.php
Edit -- https://master.php.net/note/edit/92666
Del: integrated -- https://master.php.net/note/delete/92666/integrated
Del: useless -- https://master.php.net/note/delete/92666/useless
Del: bad code -- https://master.php.net/note/delete/92666/bad+code
Del: spam -- https://master.php.net/note/delete/92666/spam
Del: non-english -- https://master.php.net/note/delete/92666/non-english
Del: in docs -- https://master.php.net/note/delete/92666/in+docs
Del: other reasons-- https://master.php.net/note/delete/92666
Reject -- https://master.php.net/note/reject/92666
Search -- https://master.php.net/manage/user-notes.php