Interface Default Methods

Read the RFC
93
169 yes
258 no

Interface Default Methods improves backwards compatibility when changing interfaces, but also add a way to have multi-inheritance in PHP.

Click the bar to cast your vote!
40%
60%
1

Implementing an interface is different than extending an abstract class

Share:
remivasco avatar
remivasco
voted no
1

Interface MUST be just declaration and NO implementation at all

Share:
ksn135 avatar
ksn135
voted no
1

Its an interface is a contract. It should have no behavior.

Share:
german avatar
german
voted no
1

Interfaces should not have specific implementations, but define specifications.

Share:
liu avatar
liu
voted no
1

It feels like an anti-pattern, we still have traits to fix this kind of thing. Multi-inheritance is not possible unfortunately, but an interface should not be misused for this.

Share:
buismaarten avatar
buismaarten
voted no
1

Having traits does not mean default methods in interfaces should no longer be allowed.

Share:
zois avatar
zois
voted yes
1

Interface = declaration Class = functionality

Share:
darren avatar
darren
voted no
1

Interfaces should remain as defining the structure and the contract.

Share:
kegan avatar
kegan
voted no
1

Keep interfaces to be interfaces!

Share:
przemyslaw avatar
przemyslaw
voted no
1

This RFC could be useful if in PHP there was no inheritance and traits. But PHP has both traits and inheritance so this should be used.

Share:
raszekster avatar
raszekster
voted no
1

Whether it's:

  • Default interface methods
  • Traits with interfaces
  • True multi-inheritance I would like to see some form of this implemented.
Share:
jim avatar
jim
voted yes
1

Separation of what and how. Besides this, it could pave the way for https://en.wikipedia.org/wiki/Multiple_inheritance which is also undesirable

Share:
koen avatar
koen
voted no
1

I personally don't need it right now but I guess it could be useful to people, since other languages have it

Share:
rastusik avatar
rastusik
voted yes
1

Sometimes a interface should have a sensible default/example.

Share:
jw avatar
jw
voted yes
1

Larry Garfield's comments here and here on the mailing list were convincing (read them!) But also every day I Ctrl+Click a method call, only to reach the interface instead of the implementation. More often than not, I'm looking for the implementation, so this slows me down. A default instead of a trait is less code, and smoother developer experience (DX).

Share:
francis avatar
francis
voted yes
RSS Feed Contribute Watch on YouTube Our License
© 2024 RFC Vote. This project is open source. Contribute and collaborate with us!