Re: [RFC] Named arguments
| From: | Mike Schinkel | Date: | Tue, 05 May 2020 18:49:17 +0000 |
| Subject: | Re: [RFC] Named arguments | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-110022@lists.php.net to get a copy of this message | ||
> On May 5, 2020, at 2:37 PM, Lynn <kjarli@gmail.com> wrote:
>
> If I understand this correctly, something like this could be done?
>
> ```
> // current version, argument name = "firstArgument"
> function example(string $firstArgument) {}
> // name changes, bc can be kept, argument name = "firstArgument" and
> "argument"
> function example(string firstArgument: $argument) {}
> ```
> This would make it possible to keep backwards compatibility, and perhaps
> even trigger a notice when called with the old name?
>
I was going to suggest similar, but with the
as keyword similar to the use in the
use statement:
function example( string $argument as firstArg ) {}
-Mike