RE: [PHP-DEV] Parameter skipping
| From: | Rowan Collins | Date: | Sun, 07 Apr 2019 10:26:04 +0000 |
| Subject: | RE: [PHP-DEV] Parameter skipping | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-105129@lists.php.net to get a copy of this message | ||
On 7 April 2019 06:00:53 BST, CHU Zhaowei <me@jhdxr.com> wrote:
>The [named parameters](https://wiki.php.net/rfc/named_params) was
>proposed in 2013. Does the problems which stopped us before still exist
>in 2019? Since we all agree named parameter should be a better
>solution, why not take a look at it first?
I'm not 100% convinced named parameters are the solution to this problem, in all cases.
In order to use named parameters, somebody needs to have declared what those names are, and made
them a stable API. If they're automatically supported on existing functions, the author might
not intend them to be used, or even realise they can, so not keep them stable (I tend to think of
parameter names as local, not contractual).
To use a default-skipping keyword, you need no extra promise than that already made, namely that the
default for any parameter is a valid value for that parameter.
Regards,
--
Rowan Collins
[IMSoP]