Re: Proposal fo "Code-free constructors declaration"
| From: | Stanislav Malyshev | Date: | Thu, 24 Jan 2019 06:45:52 +0000 |
| Subject: | Re: Proposal fo "Code-free constructors declaration" | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-103817@lists.php.net to get a copy of this message | ||
Hi!
> Proposed syntax
> class A($prop) extends B("BlaBla", $prop) {
> }
This looks like unobvious magic. PHP approach has traditionally been to
avoid unobvious magic, and be explicit about what is happening. This
functionality does not seem no be enabling anything different, and seems
to be pretty obscure as to what is going on. Also, $prop can not be
documented this way, and assigning default value to it may be a bit
weird too. I am all for paving the walkways, but this particular case
seems to be a bit too narrow to have a special language syntax for, and
the syntax seems to be not exactly obvious as to what's going on there.
--
Stas Malyshev
smalyshev@gmail.com