Re: Number Comparison..Languange Problem???

From: Date: Thu, 28 Dec 2000 17:43:15 +0000
Subject: Re: Number Comparison..Languange Problem???
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-32111@lists.php.net to get a copy of this message
Reuben D Budiardja wrote: > > 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? No, 0111 is octal and not decimal. -Egon -- SIX Offene Systeme GmbH · Stuttgart - Berlin - New York Sielminger Straße 63 · D-70771 Leinfelden-Echterdingen Fon +49 711 9909164 · Fax +49 711 9909199 http://www.six.de

« previous php.general (#32111) next »