Re: [VOTE] Interface Default Methods

From: Date: Tue, 11 Jul 2023 15:16:11 +0000
Subject: Re: [VOTE] Interface Default Methods
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-120777@lists.php.net to get a copy of this message
On Tue, Jul 11, 2023 at 4:36 PM Larry Garfield <larry@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.

« previous php.internals (#120777) next »