Re: Re: [Concept] Extension methods
| From: | Deleu | Date: | Wed, 10 Aug 2022 22:23:44 +0000 |
| Subject: | Re: Re: [Concept] Extension methods | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-118406@lists.php.net to get a copy of this message | ||
On Wed, Aug 10, 2022, 11:30 PM Rowan Tommins <rowan.collins@gmail.com>
wrote:
>
> To be honest, I put them in that order more for "purity" reasons: if they
> come before __call, they can change the existing behaviour of the class, by
> defining an extension method with the same name as a "virtual" method
> implemented with __call. That then becomes a very different feature.
>
I would argue in favor of extension having precedence over __call because
1) classes with __call wouldn't be able to be
extended and 2) extensions
could actually "fix" the ~ab~use of some use of __call. I suppose this
would allow me to write an Extension that mimics the exact behavior of
__call and actually avoid __call from being hit while still keeping the
same behavior of the class.