note 85342 added to function.empty
| From: | Anonymous at osu1 dot php dot net | Date: | Tue, 26 Aug 2008 21:11:36 +0000 |
| Subject: | note 85342 added to function.empty | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-143846@lists.php.net to get a copy of this message | ||
to john_jian,
for the loose equal operator(==), if both operands are not of the same data type, one of the operand
will be converted to have the same data type as the other,
'' == 0 is true because '' is casted to integer 0,
0 == '0' is true because '0' is casted to integer 0,
'' == '0' is false because '' string is not equal to '0'
string
----
Server IP: 208.69.120.35
Probable Submitter: 69.17.50.130
----
Manual Page -- http://www.php.net/manual/en/function.empty.php
Edit -- https://master.php.net/note/edit/85342
Del: integrated -- https://master.php.net/note/delete/85342/integrated
Del: useless -- https://master.php.net/note/delete/85342/useless
Del: bad code -- https://master.php.net/note/delete/85342/bad+code
Del: spam -- https://master.php.net/note/delete/85342/spam
Del: non-english -- https://master.php.net/note/delete/85342/non-english
Del: in docs -- https://master.php.net/note/delete/85342/in+docs
Del: other reasons-- https://master.php.net/note/delete/85342
Reject -- https://master.php.net/note/reject/85342
Search -- https://master.php.net/manage/user-notes.php