Re: RFC: C-sharp style property get/set syntax for PHP
| From: | Johannes Schlüter | Date: | Tue, 30 Nov 2010 14:34:54 +0000 |
| Subject: | Re: RFC: C-sharp style property get/set syntax for PHP | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-50732@lists.php.net to get a copy of this message | ||
On Tue, 2010-11-30 at 09:15 -0500, president@basnetworks.net wrote:
> That is true for PHP variables. isset is basically saying "does this
> variable exist", and unset is saying to get rid of it.
>
> Because properties (as defined in my RFC) are not a variable, but rather a
> set of methods, I do not think there would be any way to "unset" them.
> Like a method, once they are defined, you cannot get rid of them.
> Therefore "overloading" isset and unset would not make any sense here.
This is different from the PHP Language then. You can isset() and
unset() "native" properties. And use __isset() and __unset() magic
methods.
A new feature should be consistent with the language definition.
johannes