|
Posted by Sanders Kaufman on 07/23/07 04:25
Michael Fesser wrote:
> Quite simple: A base class with a member variable and a method that
> performs some action with that. Since this is done in the constructor,
> every child class has to be able to initialize the data before calling
> the parent constructor, as you can see in B::__construct(). If PHP would
> automatically call the parent constructor, this would be impossible.
So extended (child?) classes MUST NOT (for OOP reasons) automatically
call a constructor. Rather, it should be called manually, if and when
it's desired.
And this is not unique to PHP.
Zat right?
(Scuse me if I'm being dense, but I got some head stuff going on.)
Navigation:
[Reply to this message]
|