Re: __construct is like a normal method but without E_STRICT
| From: | Seva Lapsha | Date: | Wed, 02 Oct 2013 18:54:06 +0000 |
| Subject: | Re: __construct is like a normal method but without E_STRICT | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-69468@lists.php.net to get a copy of this message | ||
> > Am I the only one thinking this, is there actually someone who is using
> > __construct as re-initialising method?
> >
> php doesn't invoke the parent's constructor from the subclass if the
> subclass also have a constructor, so in that case calling
> parent::__construct() manually is your only option if you want the parent
> constructor to be executed.
>
AFAIU, Robert talks about the external invocation, e.g.:
<?php $a = new Obj(); $a->__construct(); ?>
Regards,
Seva