note 40648 deleted from language.types.string by nlopess
| From: | nlopess@php.net | Date: | Wed, 10 Mar 2004 16:31:57 +0000 |
| Subject: | note 40648 deleted from language.types.string by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-66567@lists.php.net to get a copy of this message | ||
Note Submitter: ibaldo@esquemas.com
----
Beware of this one! It says "Impossible" where the numbers are clearly different and they
are strings in the 1st place.
I don't know why PHP wants to convert a string to number just for comparing it and give the
wrong result because it truncated the numbers!
So be cautious when you write your code.
if ("078042005027092025011082094117019026011" ==
"078042005027092025011082094054019026011")
echo 'Impossible!';
else
echo 'Ok, they are different!';