note 27792 rejected from language.types.boolean by jmcastagnetto

From: Date: Thu, 19 Dec 2002 09:18:28 +0000
Subject: note 27792 rejected from language.types.boolean by jmcastagnetto
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-41105@lists.php.net to get a copy of this message
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!

« previous php.notes (#41105) next »