note 45690 added to function.empty
| From: | sylvain dot pasche at switzerland dot org | Date: | Wed, 15 Sep 2004 10:02:40 +0000 |
| Subject: | note 45690 added to function.empty | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-76727@lists.php.net to get a copy of this message | ||
Pay attention when you are using automatically generated properties. If you test them with emtpy, it
returns always true !
class Test {
function __get($nm) {
return "non_empty";
}
}
$test = new Test();
print $test->example; # returns "non_empty"
empty($test->example); # returns true !!
----
Manual Page -- http://www.php.net/manual/en/function.empty.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+45690
Delete -- http://master.php.net/manage/user-notes.php?action=delete+45690&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+45690&report=yes
Search -- http://master.php.net/manage/user-notes.php