Re: Implementing Generics, and none scalar default properties.
| From: | Dominic Grostate | Date: | Sat, 26 Sep 2015 10:23:00 +0000 |
| Subject: | Re: Implementing Generics, and none scalar default properties. | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-88512@lists.php.net to get a copy of this message | ||
An alternative that rfc might be to add a modifier to ctor, something like.
required public function __construct();
A required function cannot be final, because the intention is to allow it
to be overridden, but it must be called by the child impl at some point.
What do u think?
On 26 Sep 2015 8:59 am, "Stanislav Malyshev" <smalyshev@gmail.com> wrote:
> Hi!
>
> > Since there is no reason not to call parent ctor, maybe PHP should
> > somehow make every class have default empty ctor, if it doesn't have
> > one defined already - so you can write automatically
> > parent::__construct() everywhere?
>
> I completely agree with you, that's why I submitted
> https://wiki.php.net/rfc/default_ctor. Unfortunately, it was
> rejected.
>
> --
> Stas Malyshev
> smalyshev@gmail.com
>