On 2025-05-23 13:24, Anton Smirnov wrote:
Hi Alwin


Please explain the syntax you propose about this part:

> That way, you could even make it so that only specific arguments are required to be named

because I see only 2 ways to call it:

   #[AllArgsAreNamed] function f (/* ... */)

and

   function f($arg1, #[AllArgsAfterThisOneAreNamed] $arg2, $arg3)

because

   function f($arg1, #[NamedArg] $arg2, /* positional again */ $arg3)

doesn't make sense, you cannot specify a positional argument after a forced-named because it would be impossible to fill position 2 on the function call.


Just chiming in, but I interpreted it as suggesting something like

    #[RequireNamedArgs('arg2', 'arg3')]
    function f($arg1, $arg2, $arg3)

Reply via email to