I mean: Are there any things I can't implement in an abstract class? Like: Can an abstract class have a constructor, which just gets inherited by any child class? Or is the only limitation that I just can't say new AbstractClass();
?
views:
54answers:
2
+1
A:
The only difference is that abstract classes cannot be instantiated and they can define abstract methods or don't have to implement any interface method. They cannot be final, of course.
Chandra Patni
2009-12-25 22:50:57
A:
Constructors are not inherited in PHP, if you want the abstract class's constructor called, you must call it yourself in the concrete class's constructor.
Don
2009-12-27 05:53:57