My question is: are PHP very useful for developers who create their own applications themselves? Isn't it an abstract class that provides everything the interface provides?
If an interface is just a โcontractโ, doesn't the developer know about the things that a class should implement?
The only advantage I can think of is that a class can implement several interfaces, but then again, how useful it is ... when you know everything that a class needs to implement. You just force yourself to implement these methods.
As you can understand, I'm still waiting for this moment of A-HA, when I really understand why the interface is useful.
To wrap this up and make it simple: when should you use interfaces and why not use abstract classes?
oop php interface
danidacar
source share