Re: Parameter skipping
| From: | Morgan Breden | Date: | Sat, 06 Apr 2019 22:45:38 +0000 |
| Subject: | Re: Parameter skipping | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-105124@lists.php.net to get a copy of this message | ||
The problem I see with this approach is that a keyword for skipping
parameters
would really just be a stopgap solution until something like Named
Parameters
can be added.
Is it really appropriate to add a feature that only serves a temporary
purpose?
On Sat, Apr 6, 2019 at 5:15 PM Craig Duncan <php@duncanc.co.uk> wrote:
> Hi all,
>
> After starting to use
> https://wiki.php.net/rfc/json_throw_on_error in PHP
> 7.3 I've encountered the annoying issue of having to pass the $depth
> parameter as 512 every time I want json_decode() to throw.
>
> After doing this a few times I remembered the parameter skipping RFC that
> Stas proposed a few years ago:
> https://wiki.php.net/rfc/skipparams
>
> I've re-read the previous discussion and it seems to me there were two
> common arguments against:
> * Just design better APIs
> * Named parameters would be better
>
> Nobody has been able to crack named parameters (and it doesn't seem likely
> anytime soon), and as we've seen from the JSON example above it's not
> always as simple as having better APIs, so I wanted to see whether people
> would be willing to support the *default* keyword for optional parameters
> now.
>
> Thanks,
> Craig
>