note 44966 deleted from types.comparisons by tomsommer
| From: | tomsommer@php.net | Date: | Sat, 21 Aug 2004 15:29:04 +0000 |
| Subject: | note 44966 deleted from types.comparisons by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-75063@lists.php.net to get a copy of this message | ||
Note Submitter: rabbott at calstatela dot edu
----
How can this be justified?
$boolVal = "00" == "0";
echo "test: $boolVal;<br>";
produces:
test: 1;
We are presumably comparing the two strings "00" and "0". They shouldn't
compare as equal.
I guess that the answer is that both are cast to numbers since
$boolVal = "0000005" == "5.000000";
echo "test: $boolVal;<br>";
also produces
test: 1;