note 86627 added to language.operators.comparison
| From: | HayleyWatson at osu1 dot php dot net | Date: | Mon, 27 Oct 2008 04:45:14 +0000 |
| Subject: | note 86627 added to language.operators.comparison | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-145790@lists.php.net to get a copy of this message | ||
The cast from null to boolean is documented (on the page describing the boolean type:
null->false), and so is the cast from boolean to integer (on the page describing the integer
type: false->0), but the cast from null to integer is undefined and the fact that it is currently
implemented by casting from null to boolean and then from boolean to integer is explicitly
documented (on the page describing the integer type) as something that should not be relied on (so
null==0 is true only by accident, but ((int)(bool)null)==0 is true per specification).
Perhaps as well as a "Converting to integer" section on the integer type page there should
also be a "Converting from integer" section; similarly for the other types.
----
Server IP: 203.89.181.186
Probable Submitter: 114.134.161.9
----
Manual Page -- http://www.php.net/manual/en/language.operators.comparison.php
Edit -- https://master.php.net/note/edit/86627
Del: integrated -- https://master.php.net/note/delete/86627/integrated
Del: useless -- https://master.php.net/note/delete/86627/useless
Del: bad code -- https://master.php.net/note/delete/86627/bad+code
Del: spam -- https://master.php.net/note/delete/86627/spam
Del: non-english -- https://master.php.net/note/delete/86627/non-english
Del: in docs -- https://master.php.net/note/delete/86627/in+docs
Del: other reasons-- https://master.php.net/note/delete/86627
Reject -- https://master.php.net/note/reject/86627
Search -- https://master.php.net/manage/user-notes.php