note 114699 added to language.types.null
| From: | kuzawinski dot marcin at NOSPAM dot gmail dot com | Date: | Wed, 26 Mar 2014 00:10:58 +0000 |
| Subject: | note 114699 added to language.types.null | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-199042@lists.php.net to get a copy of this message | ||
Funny. It looks like, that there is one, and only one possible value for variable $a that will pass
this test:
($a != NULL) && ((bool)$a == NULL)
It's "0" and it works because casting string "0" to boolean gives FALSE
(and it's the only non empty string, that works this way). So remember that casting is not
"transitive".
----
Server IP: 72.52.91.14
Probable Submitter: 89.78.6.71
----
Manual Page -- http://php.net/manual/en/language.types.null.php
Edit -- https://master.php.net/note/edit/114699
Del: integrated -- https://master.php.net/note/delete/114699/integrated
Del: useless -- https://master.php.net/note/delete/114699/useless
Del: bad code -- https://master.php.net/note/delete/114699/bad+code
Del: spam -- https://master.php.net/note/delete/114699/spam
Del: non-english -- https://master.php.net/note/delete/114699/non-english
Del: in docs -- https://master.php.net/note/delete/114699/in+docs
Del: other reasons-- https://master.php.net/note/delete/114699
Reject -- https://master.php.net/note/reject/114699
Search -- https://master.php.net/manage/user-notes.php