Re: [RFC] Propety Accessors v1.1
| From: | Stas Malyshev | Date: | Tue, 16 Oct 2012 08:27:01 +0000 |
| Subject: | Re: [RFC] Propety Accessors v1.1 | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-63434@lists.php.net to get a copy of this message | ||
Hi!
> The RFC states
> ReflectionClass::getMethods() will not return accessor functions
> (hides implementation detail).
> Up until now reflection is leaky and is telling the truth. We should
> either keep that or completely clean up reflection. (mind also
> get_class_methods() and such)
I think the reflection should return all methods that exist. If the
accessors are implemented as PHP methods/functions (and I see no reason
why not) then reflection should return it. Reflection, as you pointed
out, should tell the truth. There's nothing "leaky" about it, IMO - yes,
it's an implementation detail, so what? If you don't want to use
implementation details, don't - just ignore all __ functions and don't
call them. Python, for example, has tons of __ functions, and people
live just fine with it.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227