note 101760 added to language.oop5.magic

From: Date: Mon, 10 Jan 2011 06:10:09 +0000
Subject: note 101760 added to language.oop5.magic
Groups: php.notes 
Request: Send a blank email to php-notes+get-175589@lists.php.net to get a copy of this message
Sammaye I might be misunderstanding your note, but the reason it's returning false is because you haven't overloaded isset() so it never actually uses your __get() when doing the isset($this->field) check. You could overload isset() like so: <? public function __isset($name) { return array_key_exists($key, $this->attributes); } ?> And then isset($this->field) will work as expected. ---- Server IP: 69.147.83.197 Probable Submitter: 113.192.5.2 ---- Manual Page -- http://www.php.net/manual/en/language.oop5.magic.php Edit -- https://master.php.net/note/edit/101760 Del: integrated -- https://master.php.net/note/delete/101760/integrated Del: useless -- https://master.php.net/note/delete/101760/useless Del: bad code -- https://master.php.net/note/delete/101760/bad+code Del: spam -- https://master.php.net/note/delete/101760/spam Del: non-english -- https://master.php.net/note/delete/101760/non-english Del: in docs -- https://master.php.net/note/delete/101760/in+docs Del: other reasons-- https://master.php.net/note/delete/101760 Reject -- https://master.php.net/note/reject/101760 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#175589) next »