Re: [RFC] Default constructors
| From: | Markus Fasselt | Date: | Tue, 18 Nov 2014 22:18:29 +0000 |
| Subject: | Re: [RFC] Default constructors | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-78962@lists.php.net to get a copy of this message | ||
Hi!
> Making everything descend from the same class may require a number of
> changes and much bigger design effort than this RFC aims at, with wider
> BC implications.
I am not sure, whether this might be a problem (I am just starting to
dive into PHP internals), but I can think of constructor visibility
problems. What visibility should the main constructor have?
If it is public (or protected), you can't have private constructors
anylonger
> Fatal error: Access level to Foo::__construct() must be public (as in
class BaseClass)
So there have to be changes in the validation of a class and in the
instantiation to not get this problem. Don't know whether this is a
bigger concern, but I just got this idea.