[PHP] hello world == 0 ?

2004-03-09 Thread test
why is var_dump( 0 == 'hello world') TRUE and not FALSE?

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



Re: [PHP] hello world == 0 ?

2004-03-09 Thread Tom Rogers
Hi,

Wednesday, March 10, 2004, 12:22:08 AM, you wrote:
t why is var_dump( 0 == 'hello world') TRUE and not FALSE?


because 0 is integer and the integer value of 'hello world' is 0 so
they are equal.

-- 
regards,
Tom

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



Re: [PHP] hello world == 0 ?

2004-03-09 Thread test
many thanx


Am Di, 2004-03-09 um 15.27 schrieb Tom Rogers:
 Hi,
 
 Wednesday, March 10, 2004, 12:22:08 AM, you wrote:
 t why is var_dump( 0 == 'hello world') TRUE and not FALSE?
 
 
 because 0 is integer and the integer value of 'hello world' is 0 so
 they are equal.


http://jessikak.de

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



Re: [PHP] hello world == 0 ?

2004-03-09 Thread Richard Davey
Hello test,

Tuesday, March 9, 2004, 2:22:08 PM, you wrote:

t why is var_dump( 0 == 'hello world') TRUE and not FALSE?

The same reason: intval('hello world') will equal 0.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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