On 01/04/2025 11:09, Juris Evertovskis wrote:

## Part B. Usable classes

Idea: allow using normal classes in the trait list.


Poking around in the archives, it seems there was a lot of discussion about what exactly "horizontal reuse" should look like before the current version of traits was added, way back in 2008. There were at least 4 RFCs drafted with different versions:

- https://wiki.php.net/rfc/nonbreakabletraits
- https://wiki.php.net/rfc/traits
- https://wiki.php.net/rfc/mixin
- https://wiki.php.net/rfc/horizontalreuse

That last one, interestingly, has the implemented definition of traits, but also a declined feature of "grafts", which plugged whole classes together with slightly different semantics.

You might be interested to skim through those, and some of the threads from the time (e.g. on https://externals.io) to see why they ended up how they did.


--
Rowan Tommins
[IMSoP]

Reply via email to