>> 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.

Its not a matter of consistency - Properties, as a cross-language concept
are not meant to work that way.  You need to think of a property as a set
of two methods that just have a pretty syntax.  Methods cannot be unset,
and nor should properties be allowed to.  isset() should simply tell us
whether a property with the specified name is part of the class or not.

isset() in the way you suggest would just be confusing.  It would allow is
to say that a property does not exist, when in fact it does exist.  This
is not logical.

__isset() is a whole different matter, without it we would have to assume
that every possible member name either exists or does not exist.  This is
because __isset can handle ANY member name.

Properties are bound to a single member name, therefore, they always
exist, unless you were to physically remove that property from the class,
which, like methods, that is not possible.

- Dennis


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to