> As much as I hate to be wrong, I have to say that you are correct.

Maybe I'm missing something very subtle here, but I think your first
apraisal was correct Zak.

> > I think there is no reason to convert any type if both
> > operands of the comparision are of the same type. It costs
> > time and it's completely not necessary. This is a bug.

This issue arises from the loose typing in PHP with the introduction of
first class boolean type (the true and false keywords), from my
understanding the sematics being applied here are as follows (poetic license
applied liberally);

== is (has become?) a boolean logic operator, dealing in terms of  'true'
and 'false' values, so its terms are type cast to either 'true' or 'false'.
When applied to strings, a 'false' string is zero length or contains '0',
all other strings are 'true'.
[please dont ask 'what if the string is NULL... ;-)]

If you dont want your terms to be treated as (type cast to) boolean values
use the strict equallity operator ===

> > I can not see any description of this behavior in the
> > manual. The string type section descibes only what is
> > happen if a string is converted.

The manual doesnt seem very clear on this at all, but == behaves something
like ^(A xor B)



PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to