var_dump( (0 == 'heading') ) == TRUE ?!
| From: | Daevid Vincent | Date: | Sat, 15 May 2010 01:19:39 +0000 |
| Subject: | var_dump( (0 == 'heading') ) == TRUE ?! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-305234@lists.php.net to get a copy of this message | ||
Can someone explain why an integer 0 compared to a string evaluates to
boolean true??
var_dump( (0 == 'heading') );
Yet,
var_dump( (1 == 'heading') );
Is FALSE.
WTF? I would expect the 0 one to be FALSE too.