> How these would work with isset - what !empty($this->Hours) return? What 
> would happen if you do unset($this->Hours)? What happens if you do 
> $this->Hours++ or sort($this->Hours) (assuming $Hours is an array)?
> These things need to be defined in the RFC too.

So I've just tested these things and the accessors perform the same way as with 
__get()/__set().

empty() - Returns true for a property retrieved via __get() or via a getter -- 
Any idea why this would be the case for __get()?  Is this a bug?

unset() - Would unset a temporary variable (the one returned by the getter) -- 
see previous email re: adding unset/isset property functions.

sort() - Does the same thing as with __get()/__set() which is to say, the array 
is sorted but the property is not updated with the value.  Should accessor 
behave differently than the magic methods?  Should this just be documents or 
should this be fixed?

-Clint

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

Reply via email to