Re: Why parent::construct not called?

From: Date: Sun, 23 Feb 2003 17:29:05 +0000
Subject: Re: Why parent::construct not called?
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-94498@lists.php.net to get a copy of this message
On Sun, 2003-02-23 at 18:04, michel 'ziobudda' morelli wrote: > Il dom, 2003-02-23 alle 17:32, Marcus Börger ha scritto: > > You can do the following: > > class base { > > function __construct() { > > echo "base::__construct()\n"; > > } > [...] > > I know know. > > What I want to understand is why the base::__construct() is called (in > automatic) only when derived::__constuct() is missing. Because (from a user's point of view) the constructor is inherited just like any other function. > I think that or the base::__construct() is always in automatic called or > it is always never called (in automatic). Well, because there might be situations in which I'd like to call the parent's constructor before my code in __construct, sometimes after it and in some situations, not call it at all. - Timm

« previous php.dev (#94498) next »