note 84129 deleted from language.oop5.overloading by danielc
| From: | danielc@php.net | Date: | Sat, 19 Jul 2008 23:08:21 +0000 |
| Subject: | note 84129 deleted from language.oop5.overloading by danielc | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-141781@lists.php.net to get a copy of this message | ||
Note Submitter: justin at redwiredesign dot com
Reason: 1
----
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();
}
}