note 16897 added to language.types.null

From: Date: Sun, 18 Nov 2001 00:34:50 +0000
Subject: note 16897 added to language.types.null
Groups: php.notes 
Request: Send a blank email to php-notes+get-20965@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 -- http://www.php.net/manual/en/language.types.null.php http://master.php.net/manage/user-notes.php?action=edit+16897 http://master.php.net/manage/user-notes.php?action=delete+16897 http://master.php.net/manage/user-notes.php?action=reject+16897

« previous php.notes (#20965) next »