note 94590 added to function.empty

From: Date: Fri, 13 Nov 2009 04:56:02 +0000
Subject: note 94590 added to function.empty
Groups: php.notes 
Request: Send a blank email to php-notes+get-162850@lists.php.net to get a copy of this message
I agree with Janci that the documentation could be clarified by stating that using empty() on inaccessible object properties will always return TRUE if the __isset overloading method is not declared. However, I think Janci's example makes the behavior in these cases seem less straightforward than it actually is. Using this __isset() magic function is sufficient for his example: <?php public function __isset($key) { return isset($this->_items[$key]); } ?> ---- Server IP: 69.147.83.197 Probable Submitter: 131.170.90.2 (proxied: 127.0.0.1) ---- Manual Page -- http://www.php.net/manual/en/function.empty.php Edit -- https://master.php.net/note/edit/94590 Del: integrated -- https://master.php.net/note/delete/94590/integrated Del: useless -- https://master.php.net/note/delete/94590/useless Del: bad code -- https://master.php.net/note/delete/94590/bad+code Del: spam -- https://master.php.net/note/delete/94590/spam Del: non-english -- https://master.php.net/note/delete/94590/non-english Del: in docs -- https://master.php.net/note/delete/94590/in+docs Del: other reasons-- https://master.php.net/note/delete/94590 Reject -- https://master.php.net/note/reject/94590 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#162850) next »