note 101931 added to language.types.type-juggling

From: Date: Wed, 19 Jan 2011 02:09:33 +0000
Subject: note 101931 added to language.types.type-juggling
Groups: php.notes 
Request: Send a blank email to php-notes+get-175878@lists.php.net to get a copy of this message
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! ---- Server IP: 69.147.83.197 Probable Submitter: 78.171.137.224 ---- Manual Page -- http://www.php.net/manual/en/language.types.type-juggling.php Edit -- https://master.php.net/note/edit/101931 Del: integrated -- https://master.php.net/note/delete/101931/integrated Del: useless -- https://master.php.net/note/delete/101931/useless Del: bad code -- https://master.php.net/note/delete/101931/bad+code Del: spam -- https://master.php.net/note/delete/101931/spam Del: non-english -- https://master.php.net/note/delete/101931/non-english Del: in docs -- https://master.php.net/note/delete/101931/in+docs Del: other reasons-- https://master.php.net/note/delete/101931 Reject -- https://master.php.net/note/reject/101931 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#175878) next »