note 84129 added to language.oop5.overloading
| From: | justin at redwiredesign dot com | Date: | Mon, 30 Jun 2008 09:59:13 +0000 |
| Subject: | note 84129 added to language.oop5.overloading | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-141000@lists.php.net to get a copy of this message | ||
The documentation isn't explicit in how it describes __get().
So, in your __get function, you return the value that you're trying to get or in my case, the
object you've defined.
function __get ($var)
{
if ($var == 'name')
{
return 'fred';
}
if ($var == 'obj')
{
return new MyObj();
}
}
----
Server IP: 87.124.64.96
Probable Submitter: 87.194.35.152
----
Manual Page -- http://www.php.net/manual/en/language.oop5.overloading.php
Edit -- https://master.php.net/note/edit/84129
Del: integrated -- https://master.php.net/note/delete/84129/integrated
Del: useless -- https://master.php.net/note/delete/84129/useless
Del: bad code -- https://master.php.net/note/delete/84129/bad+code
Del: spam -- https://master.php.net/note/delete/84129/spam
Del: non-english -- https://master.php.net/note/delete/84129/non-english
Del: in docs -- https://master.php.net/note/delete/84129/in+docs
Del: other reasons-- https://master.php.net/note/delete/84129
Reject -- https://master.php.net/note/reject/84129
Search -- https://master.php.net/manage/user-notes.php