note 103248 deleted from language.operators.comparison by danbrown

From: Date: Mon, 04 Apr 2011 14:22:23 +0000
Subject: note 103248 deleted from language.operators.comparison by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-178466@lists.php.net to get a copy of this message
Note Submitter: ensnnet at gmail dot com ---- The next code: <?php $a = "12E0"; $b = "12"; if($a==$b) echo "Equals"; else echo "Not equals"; ?> Show: Equals I think that the reason is that "12E0" is evaluated as 12 x 10 exp(0) = 12 and then the two strings are compared as integers.

« previous php.notes (#178466) next »