You are here: Re: [PHP] Re: Re: Re: __get() not reentrant? « PHP « IT news, forums, messages
Re: [PHP] Re: Re: Re: __get() not reentrant?

Posted by Jochem Maas on 05/24/05 14:55

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
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация