On 1 December 2010 12:30, Stas Malyshev <smalys...@sugarcrm.com> wrote:
> Hi!
>
>> No. The prototype of all setters would be the same. As would the
>> prototype of all getters.
>
> But we'd have two sets of properties - one handled by __get/__isset, another
> - by get($isset). Not a good idea.

So, should properties isset/unset go via the magic methods?

With properties, there would be the duplication anyway (__get()/get()
and __set()/set()).

Either way, only the property knows what should happen when an isset()
or unset() is called against it. It is for that reason that I think
the property should handle it.

__get, __set, __isset and __unset are for undefined class members. Not
properties. From the user of the class, completely invisible.


Having more than 1 way to skin the cat is pretty much de rigueur for PHP.




-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

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

Reply via email to