Re: Allow default parameters before non-default ones?
| From: | Mark Randall | Date: | Thu, 09 Dec 2021 05:48:15 +0000 |
| Subject: | Re: Allow default parameters before non-default ones? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-116598@lists.php.net to get a copy of this message | ||
On 09/12/2021 05:22, André Hänsel wrote:
This is very useful because I can add an optional parameter to a function and prevent users of my function from using the parameter in a positional way. This way I don't have to make a compatibility promise to never change the position of this parameter.I would much prefer we could find a way to give this proper support rather than a hack. I frequently use large numbers of named arguments and would very much like to be able to knock out the ability to use positional arguments, thus ensuring I can change the order (e.g. inserting a new argument after a related one) without a BC break.