Re: [VOTE] Named arguments
| From: | Rowan Tommins | Date: | Fri, 10 Jul 2020 10:11:19 +0000 |
| Subject: | Re: [VOTE] Named arguments | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-110913@lists.php.net to get a copy of this message | ||
On Fri, 10 Jul 2020 at 10:21, Marco Pivetta <ocramius@gmail.com> wrote:
> I kept my "NO" stance here, as per discussion in
> https://externals.io/message/110004#110005, where I provided
> (in my
> opinion) good/safe alternatives to arrays as input parameters.
>
For the record, I maintain my reaction from
https://externals.io/message/110004#110010
that the example you give
"cheats" by including a "fromArray" method which simply emulates named
parameters, but without any assistance from the language would require a
large amount of boiler-plate to do so.
Would you be more open to a version of the feature that was opt-in at the
definition site? Then your example could swap the hand-rolled documentation
and validation in "fromArray" for a fully typed signature in
"fromNamedParams", and the only compatibility promises would be ones
already made by "fromArray" anyway.
Regards,
--
Rowan Tommins
[IMSoP]