note 86634 added to function.empty
| From: | nizamgok at gmail dot com | Date: | Mon, 27 Oct 2008 14:52:15 +0000 |
| Subject: | note 86634 added to function.empty | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-145835@lists.php.net to get a copy of this message | ||
By definition empty( mixed* $var ) cannot accept all types. For example, define constants will
cause error if you try to test them.
* mixed indicates that a parameter may accept multiple (but not necessarily all) types.
This will produce error:
define("CONSTANT", "Hello world.");
var_dump( empty( CONSTANT ) );
At first, this seemed to me very legal, but then I realized the fact that it just doesn't
work.
----
Server IP: 219.94.145.73
Probable Submitter: 219.16.104.28
----
Manual Page -- http://www.php.net/manual/en/function.empty.php
Edit -- https://master.php.net/note/edit/86634
Del: integrated -- https://master.php.net/note/delete/86634/integrated
Del: useless -- https://master.php.net/note/delete/86634/useless
Del: bad code -- https://master.php.net/note/delete/86634/bad+code
Del: spam -- https://master.php.net/note/delete/86634/spam
Del: non-english -- https://master.php.net/note/delete/86634/non-english
Del: in docs -- https://master.php.net/note/delete/86634/in+docs
Del: other reasons-- https://master.php.net/note/delete/86634
Reject -- https://master.php.net/note/reject/86634
Search -- https://master.php.net/manage/user-notes.php