Re: Odd Code Error.

From: Date: Wed, 21 Jan 2004 03:39:22 +0000
Subject: Re: Odd Code Error.
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-175263@lists.php.net to get a copy of this message
yeah its strange, $test is equal to $test2, $test is equal to $test3 but $test2 is not equal to $test3, $test = "string"; $test2 = true; $test3 = 0; if($test == $test2){ echo "hi"; } somone tell me im wrong please? else thats seriously weird -- Luke <daniel@electroteque.org> wrote in message news:47522.203.15.102.65.1074640154.squirrel@www.electroteque.org... > i've never had a problem doing if ($var=="test") ?? > > > I've come across this recently too. I think what's happening is that > > PHP is converting "NFH" to an integer, which would be zero in this > > case. Thus zero == zero is true... > > > > Try doing type checking too: > > if ($EA === "NFH") > > > > Martin > >

« previous php.general (#175263) next »