Re: __get() accessor question (a bug maybe?)
| From: | Barry | Date: | Wed, 15 Nov 2006 16:08:07 +0000 |
| Subject: | Re: __get() accessor question (a bug maybe?) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-244670@lists.php.net to get a copy of this message | ||
TemuriI schrieb:
Hi all, here is the code I am having problem with: ============================================ class baseForm { private $_id = 10; function __get($member) {-- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)echo "Accessing member \"{$member}\" : <br />\n"; return $this->$member;} function checkID() {echo $this->_id."<br />\n";} } class inputText extends baseForm { function display() {$this->checkID(); echo $this->_id."<br />\n";} } $f = new inputText(); echo $f -> display(); ============================================ Probably bcause its private and therefore only for that class?