Re: note 27792 added to language.types.boolean

From: Date: Thu, 19 Dec 2002 09:18:11 +0000
Subject: Re: note 27792 added to language.types.boolean
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-41104@lists.php.net to get a copy of this message
This is explained in the "Type juggling" section of the manual. Your note will be removed. --- thebitman@attbi.com wrote: > Dont really know where else to put this so I'll say > it here. After a lot of debugging I have found in my > code that '0' (bare, no quotes), appears to match > ANY TEXT STRING. So (0 == "R_NOW") is true, (0 == > "TRUE") is true, or anything else you might consider > throwing at it in a situation where something could > be 0 or a string and you just want to check. > To avoid this, ALWAYS use preg_match() and NEVER > '==' on anything that has the remote possibility of > being either a string or an int! > -- > http://www.php.net/manual/en/language.types.boolean.php > http://master.php.net/manage/user-notes.php?action=edit+27792 > http://master.php.net/manage/user-notes.php?action=delete+27792 > http://master.php.net/manage/user-notes.php?action=reject+27792 > > > -- > PHP Notes Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > ===== --- Jesus M. Castagnetto <jmcastagnetto@php.net> __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com

« previous php.notes (#41104) next »