On Tue, Jul 11, 2023 at 4:36 PM Larry Garfield <la...@garfieldtech.com> wrote:
> You have to check your vendor folder for an interface, or trait, or abstract 
> class.  That doesn't change anything.
>
> As noted, now consider a Baz interface.  For interface-and-trait, you add 2 
> more definitions.  For interface-with-defaults, you add 1.  For abstract 
> classes, you need to add 4: BazBase, FooBazBase, BarBazBase, and 
> FooBarBazBase.

I guess I don't understand what the interface is solving if you're
creating an interface _and_ a trait, why not just create the trait? It
sounds like you're coupling your interface to a specific
implementation and trying to get multi-inheritance out of PHP. This
seems like a design issue, and this RFC seems like a back-way to
multiple inheritance. Why not just allow multiple inheritance?

> And that's assuming you're even in control of the base classes; you may not 
> even be able to create all those combinations without lots of copy-pasta.
>
> Abstract classes are basically vestigial since PHP 5.4, and have no use cases:

As a user of abstract classes since the early days of C++, I disagree.

I'd love to see a concrete example, but to me, this just seems like a
bandaid on an architectural smell.

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to