Re: New feature: sequential constructors
| From: | Sanford Whiteman | Date: | Wed, 03 Jul 2013 18:05:14 +0000 |
| Subject: | Re: New feature: sequential constructors | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-68051@lists.php.net to get a copy of this message | ||
I suggest you read this recent thread for related commentary.
http://www.serverphorums.com/read.php?7,712222
In there, I refer to your proposal as Contractual Call Super and I
find it an interesting concept that helps avoid the "advisory call
super" antipattern.
However --
> If the introduction of a new keyword is problematic, perhaps this same
> behaviour could be enacted in cases where an inheriting class has a
> constructor and the base class' constructor is defined as final i.e. rather
> than causing an error, the final constructor is executed first, followed by
> any other constructors in the hierarchy.
-- this is a horrible idea.
final has distinct semantic meaning. It
means "cannot override." It doesn't mean "overrideable, but we'll call
any/all supers before/after we run yours." It's a BC break.
Fuggedaboutit.
The feature you want isn't in the language -- maybe it should be --
and you can't change the meaning of existing keywords.
-- S.