Re: Re: Real properties in PHP
| From: | Derick Rethans | Date: | Thu, 25 Aug 2005 10:53:31 +0000 |
| Subject: | Re: Re: Real properties in PHP | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-18410@lists.php.net to get a copy of this message | ||
On Thu, 25 Aug 2005, Christian Schneider wrote:
> This can be easily done with
>
> function __get($name)
> {
> $get = "get_$name";
>
> return $this->$get();
> }
>
> function __set($name, $value)
> {
> $set = "set_$name";
>
> $this->$set($value);
> }
>
> in your base class (the function names are then get_fullName/set_fullName.
But that has plenty of problems, like I described here:
http://news.php.net/php.internals/17491
Derick
--
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org