1. The use of the interface is through the keyword implements. The use of abstract classes is through the keyword extends. Of course, interfaces can also be inherited through the keyword extends.
2. Member variables (including class static variables) cannot be declared in the interface, but class constants can be declared. Various types of member variables can be declared in abstract classes to implement data encapsulation.
3. Interfaces do not have constructors, while abstract classes can have constructors.
4. Methods in interfaces are of public type by default, while methods in abstract classes can be modified with private, protected, and public.
5. A class can implement multiple interfaces at the same time, but a class can only inherit from one abstract class.
Abstract class or interface.
The above has introduced the difference between PHP abstract classes and interfaces, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.