Re: Bug #12453: comparing 0=="null" is true?

From: Date: Mon, 30 Jul 2001 08:06:38 +0000
Subject: Re: Bug #12453: comparing 0=="null" is true?
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-61478@lists.php.net to get a copy of this message
UNSUBSCRIBE ME PLEASE!!!!!!!!!!!!!! teo@gecadsoftware.com schrieb: > Hi btanner! > On Sun, 29 Jul 2001, btanner@home.com wrote: > > > From: btanner@home.com > > Operating system: Win2k > > PHP version: 4.0.6 > > PHP Bug Type: Scripting Engine problem > > Bug description: comparing 0=="null" is true? > > > > If you compare the integer(0) to the string "null", PHP thinks they are the > > same. > > > > Am I hopped up on goofballs, or whats up here? > > > > $MyVar=0; > > if($MyVar=="null") > > print("apparently $MyVar is equal to \"null\""); > try intval("null") to see why > $MyVar isn't converted to string, "null" is converted to int. > > -- teodor > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > For additional commands, e-mail: php-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.dev (#61478) next »