At 02:36 30.01.2003, Webapprentice said:
--------------------[snip]--------------------
>Hi,
>I have a conditional:
>if (a == b)
>
>a is the number 0, but b is a string "Friday August 22".
>
>The condition is evaluating as true, which is not what I want.
>What am I misunderstanding?
--------------------[snip]-------------------- 

PHP tries to "help" you - you can only compare data of the same type. So
PHP goes ahead and casts this for you, a string to int in this case.

If you compare it using "===" (typesafe comparison) you will get correct
results.    


-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to