note 16897 deleted from language.types.null by jimw
| From: | jimw@php.net | Date: | Sat, 08 Dec 2001 23:28:20 +0000 |
| Subject: | note 16897 deleted from language.types.null by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-22335@lists.php.net to get a copy of this message | ||
Be careful not to confuse an empty string value ("") with a NULL value.
$a = "";
$b = NULL;
echo $a == $b ? "TRUE" : "FALSE";
/*
returns TRUE for some reason that I cannot understand (is this a bug?)
*/
//Meanwhile,
echo is_null($a); //returns FALSE
echo is_null($b); //returns TRUE
echo isset($a); //returns TRUE
echo isset($b); //returns FALSE
echo empty($a); //returns TRUE
echo empty($b); //returns TRUE