note 101931 deleted from language.types.type-juggling by thiago
| From: | thiago@php.net | Date: | Wed, 19 Jan 2011 02:53:59 +0000 |
| Subject: | note 101931 deleted from language.types.type-juggling by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-175879@lists.php.net to get a copy of this message | ||
Note Submitter: ma(remove-this)izist at g(and-this)mail dot dom
----
be aware var_dump(0 == 'any string') will output bool(true)! i think php automatically
casts string to integer, why not casting integer to string?
Here is some interesting results:
<?php
var_dump(0 == 'any string'); //true
var_dump(false == 0); //true
var_dump(false == 'any string'); //false
?>
0 is equal to 'any string' and 0 is also equal to false so 'any string' must be
equal to false. But php doesn't agree!