Re: possible bug (string equality to zero)?
| From: | Christopher J. Bottaro | Date: | Thu, 11 Aug 2005 17:10:38 +0000 |
| Subject: | Re: possible bug (string equality to zero)? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-220453@lists.php.net to get a copy of this message | ||
Scott Noyes wrote:
>> [snip]
>> Is it a bug that ($var == 0) is always true for any string $var?
>> [/snip]
>>
>> You are comparing a string to an integer.
>
> Right. This is clearly documented at
> http://www.php.net/operators.comparison
>
Oh, I see...it converts the string into number, not the other way around.
Thanks for the link.