Re: [Proposal] call_user_func_map(): flexible named parameter mapping for call_user_func*

From: Date: Fri, 02 Jul 2021 04:30:35 +0000
Subject: Re: [Proposal] call_user_func_map(): flexible named parameter mapping for call_user_func*
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-115271@lists.php.net to get a copy of this message
Hello,

On Sun, 27 Jun 2021 at 19:09, Ralph Schindler <ralph@ralphschindler.com>
wrote:

>
> This proposes a method for a publisher/framework/producer (the caller of
> the callback) to document all the parameters that are available as named
> parameters, and subscribers/consumers (creator of the callback) could
> subscribe to what they need by name.
>

Wouldn't it rather be nice if we had more detailed callable types instead?
I mean instead of simply defining a parameter type as callable we could
specifically define what the callable expects.

Something like this:
```
function bar ((int, string):bool $callback) {...}
```

A more generic approach that could be more descriptive, maybe.

I have no clue if this was already discussed in other threads or not. And
whether it is feasible to implement.

Regards,


Thread (9 messages)

« previous php.internals (#115271) next »