r/PHPhelp • u/[deleted] • Nov 17 '22
Solved PHP Abstract Classes, PHP Interfaces
I read about it online and still can't understand what these two is about. How does it work and when do you use these two? Can someone give example and explain these to me in simple words? Thanks!
8
Upvotes
1
u/ZippyTheWonderSnail Nov 17 '22
An abstract class is like an interface with the ability to add functional code. So a class which extends an abstract class may have to implement functions, and may also inherit functions and properties.
https://www.php.net/manual/en/language.oop5.abstract.php