I have been programming PHP for half year now, I am into Object-Oriented for 3 months.
But I have never used Abstracted class or a Interface
.
One of my mates explained, but in Java:
If you want to give a certain class a structure, like implementing an interface as Entity, all underlying classes must inherit the methods from the interface and give it a body.
But I still don't understand, in PHP. I can't find any moment to use the Interface.
When do people usually find Interfaces useful? Are they useful? Or I can live without them? Can you show me a perfect example of a right moment to use a interface?
I've read in the Documentation, but didn't understand either.
Another question:
If I want to use different files for interfaces, for example:
Body.interface.php
To use that interface in the specific class, do I have to use include(), right?