Re: [RFC] Property Accessors v1.2 : Internal Accessor Method Visibility / Callability
| From: | Stas Malyshev | Date: | Sun, 28 Oct 2012 06:47:43 +0000 |
| Subject: | Re: [RFC] Property Accessors v1.2 : Internal Accessor Method Visibility / Callability | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-63684@lists.php.net to get a copy of this message | ||
Hi!
> 1) Currently __get() is only checked/invoked if there is not a property
> already defined; ie properties shadow __get() (no performance penalty)
Yes, that's kind of the point of it - extending __get.
> 2) It would dramatically reduce performance because every property
> access would have to create the function string, get it's hash value and
> do a hash look up against the function table, just to see if there is a
Not really, as we have property_info structure where we could record the
existence of such functions and we check property_info anyway AFAIR.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227