Re: [RFC] Property Accessors v1.2 : Internal Accessor Method Visibility / Callability
| From: | Patrick Schaaf | Date: | Sat, 27 Oct 2012 08:01:39 +0000 |
| Subject: | Re: [RFC] Property Accessors v1.2 : Internal Accessor Method Visibility / Callability | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-63661@lists.php.net to get a copy of this message | ||
> > - i.e. name them __prop_get_xxx, __prop_set_xxx, and so on.
>
> I think it'd more natural to make it __set__PROPNAME. Though __set_state
> is a static method, so maybe we can live with it - except that you won't
> be able to declare property named $_state.
Needing an "except" is inelegant, if it can be avoided up front.
Also, having __prop_get_XXX etc. is a bit more descriptive to somebody
later "wondering" what these methods are - prop alludes to properties,
which is what the methods are about. I can already see the stack overflow
subject, "what are these __prop methods in new PHP" :)
best regards
Patrick