Christopher J. Bottaro wrote:
Richard Lynch wrote:
On Sun, May 22, 2005 3:24 pm, Christopher J. Bottaro said:
And what would make it any different from a normal recursive function?
The fact that *ANY* attempt to access a mis-typed property would kick in a
__get() call, and that's too frickin' easy to happen in code that's too
easy to fly by QA in large-scale applications springs to mind...
Not saying you're "wrong" or they're "right" just that it's not quite as
simple as a normal recursive function or loop iteration.
I completely disagree. I don't mean any offense to anyone here, but I find
it kind of ridiculous for a language to restrict itself that like in this
case. Its insulting to our intelligence as programmers.
and another thing, take this rather contrived/simple example of making
set (as opposed to non-existent) [non-public] properties available via
the property access syntax:
public function __get($varName)
{
return isset($this->$varName) ? $this->$varName: null;
}
which would be impossible to do as is if __get() was 'reentrant' (whatever that means exactly,
we both/all at least know that we mean that you can call it recursively...)
actually if __get() worked in such a recursive way then it would be impossible to actually
access any properties of the object.
also note that __get() only comes into play if the property requested is not public or is not
set.....
the internals mailing list has stuff in the archives about __get() which probably explains
it a whole load better (including the reasoning behind the decisions etc etc) which may
be of interest to you.
these are not the droids your looking for, move along. :-)
-- C
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php