indrek siitan wrote:
> 
> Hi,
> 
> <?
>   $value=0;
>   if ($value=="NULL")
>     echo "Value is NULL!";
>   else
>     echo "Value is not null.";
> ?>
> 
> output: Value is NULL!
> 
> is it a bug or expected behaviour? tested it on 4.0.4pl1.
> i got around it by using strcasecmp(), but just wondering. :)
> 

It's expected behaviour, i think.
'cause $value is integer, "NULL" is string and compare will convert
"NULL" into integer.
If condition is ($value==="NULL"), then output will be "Value is not
null.".

RTFM ;-)

-- 
Pavel a.k.a. Papi

-- 
PHP General 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