Hi Robert,

Thanks.

Regards,

Justin Palmer

-----Original Message-----
From: Robert Cummings [mailto:[EMAIL PROTECTED] 
Sent: Monday, May 10, 2004 12:22 PM
To: [EMAIL PROTECTED]
Cc: PHP-General
Subject: Re: [PHP] 0 == null ?


On Mon, 2004-05-10 at 15:17, Justin Palmer wrote:
> Hi,
> 
> Does 0(zero) really equate to null?
> 
> if( 0 == null )
> {
>       echo 'true';
> }
> else echo 'false';
> 
> Result echo's: true
> 
> This can not be right, can it?  I have never heard of such a thing.  
> As far as I recall from any language null is of no value equaling 
> nothing? So how can it equal 0?
> 
> Any help or explanation would be greatly appreciated.

In C the NULL macro is equal to 0. In PHP null is equivalent to 0. The
test will fail if you use === instead.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  | a 
| powerful, scalable system for accessing system services  | such as 
| forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

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

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

Reply via email to