Hey, I’m quite experienced with PHP but I have no idea what the keyword abstract does when it comes down to object orientated programming. Can anyone explain in plain english what it can be used for?
What situations would I use the abstract keyword in? How does it change the class/interface?
(Hope this is simple enough — I don’t think I can do better ^^ )
An
abstractclass can not be instanciated : you can only create another class that inherits from theabstractclass, and instanciate that child class.And if you declare some methods as
abstract, those must be defined in the child class, for that one to be instanciable.