Re: Proposal fo "Code-free constructors declaration"
| From: | Rowan Collins | Date: | Fri, 25 Jan 2019 16:36:57 +0000 |
| Subject: | Re: Proposal fo "Code-free constructors declaration" | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-103849@lists.php.net to get a copy of this message | ||
On Fri, 25 Jan 2019 at 15:37, Levi Morrison <levim@php.net> wrote:
>
> If you have any more complex of a need (such as private variables)
> then I think you should write the constructor. The reason is that if
> you have private variables, you need to establish a public API
> contract.
>
Right, which is why I think this is solving a different problem.
The OP was proposing a syntax that would allow you to simplify cases like
"call parent constructor with this constant, then set these 3 properties";
a call-time syntax like this is no use for that.
Regards,
--
Rowan Collins
[IMSoP]