note 24278 added to language.types.boolean

From: Date: Mon, 12 Aug 2002 03:03:09 +0000
Subject: note 24278 added to language.types.boolean
Groups: php.notes 
Request: Send a blank email to php-notes+get-34830@lists.php.net to get a copy of this message
"CAT" is either getting converted to FALSE or 0, or 0.1 is getting treated as a string, because False gets echoed. $TestValue = 0.1; if ( $TestValue == "CAT" ) { echo "True"; } else { echo "False"; } But 0 is not getting converted to a string. "CAT" is either getting converted to FALSE or 0, because True gets echoed. $TestValue = 0; if ( $TestValue == "CAT" ) { echo "True"; } else { echo "False"; } "CAT" is being compared to "DOG", because False gets echoed. $TestValue = "DOG"; if ( $TestValue == "CAT" ) { echo "True"; } else { echo "False"; } -- http://www.php.net/manual/en/language.types.boolean.php http://master.php.net/manage/user-notes.php?action=edit+24278 http://master.php.net/manage/user-notes.php?action=delete+24278 http://master.php.net/manage/user-notes.php?action=reject+24278

« previous php.notes (#34830) next »