note 19934 added to language.types.boolean

From: Date: Fri, 15 Mar 2002 15:26:22 +0000
Subject: note 19934 added to language.types.boolean
Groups: php.notes 
Request: Send a blank email to php-notes+get-27835@lists.php.net to get a copy of this message
That's not right. True and false are no constants since PHP4 but values of the type boolean. If you try the code if (1 == true) echo "True. 1 and true are equal."; you will notice that 1 and true are considered equal. The operator === (and its oposite !==) however compares values type sensitive: if (1 === true) echo "False. True is no integer."; -- http://www.php.net/manual/en/language.types.boolean.php http://master.php.net/manage/user-notes.php?action=edit+19934 http://master.php.net/manage/user-notes.php?action=delete+19934 http://master.php.net/manage/user-notes.php?action=reject+19934

« previous php.notes (#27835) next »