Am 03.07.23 um 02:11 schrieb Levi Morrison:
Chatter on the [Interface Default Methods RFC][1] has been quiet for
the past 6 days, and the feature freeze deadline is fast approaching
for PHP 8.3, so I'm moving this to vote. It'll be open for two weeks
as usual.

Thanks to everyone who discussed weaknesses in the RFC during the
discussion phase.

   [1]: https://wiki.php.net/rfc/interface-default-methods

I've voted "no" on this RFC for one simple reason:

For me an interface is about the abstraction of a contract. It defines how different parts of code interact with one another without having to know about the implementation.

With this RFC we are adding implementation details to the abstraction.

That requires knowledge about the implementation of different parts of the code. Which we do not have when defining an interface.

If we have this knowledge then we are not defining an interface but an implementation were some implementation details need to be overwritten depending on business-logic. That is what an abstract class is there for.

And TBH: I do not really care whether there are other languages that think that is a good idea: For me it is not.

If one needs default implementations of an interface: Use Traits. But leave the contract abstract. ANd if you need to declare some methods to be implemented while others are fixed: Use abstract classes.

My 0.02€

Cheers

Andreas
--
                                                              ,,,
                                                             (o o)
+---------------------------------------------------------ooO-(_)-Ooo-+
| Andreas Heigl                                                       |
| mailto:andr...@heigl.org                  N 50°22'59.5" E 08°23'58" |
| https://andreas.heigl.org                      https://hei.gl/where |
|                                        https://hei.gl/pubkeyandreas |
+---------------------------------------------------------------------+

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

Reply via email to