>> That is true for PHP variables. isset is basically saying "does this >> variable exist", and unset is saying to get rid of it. > > This is also true for object properties - see magic methods. I don't see > why you shouldn't be able to unset them - you can do that with regular > properties... So what you imagine would happen if you call > unset($foo->property) or isset($foo->property)?
As I replied elsewhere: 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 in a class either exists or does not exist. This is because __isset, __get, __set and __unset 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