Re: Class Extension
| From: | Michael Morris | Date: | Wed, 08 Jul 2026 12:07:07 +0000 |
| Subject: | Re: Class Extension | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-131814@lists.php.net to get a copy of this message | ||
On Wed, Jul 8, 2026 at 1:08 AM Holly Schilling <
holly.a.schilling@outlook.com> wrote:
> Following the discussion in Discord yesterday, I started working on the
> feasibility of implementing class extensions. I believe I’ve proven out the
> concept and viability of it in a 2-phase approach using an extension syntax
> similar to that of Swift.
>
> Before I go into much more detail, what is the general interest in adding
> this to the language?
>
We have inheritance (extends keyword, parent / child classes)
We have traits (an implementation of multiple classes taken from Ruby)
Looking at Swift's extension syntax I fail to see anything it adds not
covered by the above.