RE: [PHP] Number Comparison..Languange Problem???

From: Date: Thu, 28 Dec 2000 17:42:10 +0000
Subject: RE: [PHP] Number Comparison..Languange Problem???
Groups: php.general 
Request: Send a blank email to php-general+get-32109@lists.php.net to get a copy of this message
Don't quote me on this, but I think the prefix "0" tells PHP that the number is octal (i.e. base 8 not base 10), in which case 111 doesn't equal 111, if you see what I mean. Regards, Ollie > -----Original Message----- > From: Reuben D Budiardja [mailto:reubendb@goshen.edu] > Sent: 28 December 2000 17:36 > To: php-general@lists.php.net > Subject: [PHP] Number Comparison..Languange Problem??? > > > > Suppose I have something like: > $var1 = 0111; > $var2 = 111; > > and I do: > > if($var1 == $var2) > echo "TRUE"; > else > echo "FALSE"; > > that will return false. Isn't that supposse to be true, since 0111 is > essentially 111, and they both are the same type (ie. number)? the > variables are not define as string, so why do they give me > FALSE in the > comparison? > > Thanks for any help > Reuben D. Budiardja > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net >

« previous php.general (#32109) next »