Re: [RFC] Partial Function Application v2
| From: | Larry Garfield | Date: | Tue, 29 Jul 2025 15:56:47 +0000 |
| Subject: | Re: [RFC] Partial Function Application v2 | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-128297@lists.php.net to get a copy of this message | ||
On Tue, Jul 22, 2025, at 3:02 PM, Larry Garfield wrote:
> Hi folks. Just a quick update: We've made one small change to the RFC.
> Specifically, in order to prevent accidentally calling optional
> arguments from callback locations like array_map() or array_find(), a
> partial created with foo(?) will ignore any additional arguments passed
> to it, and will not pass those through to the underlying function. A
> partial that uses foo(?, ...) will pass through whatever it gets.
>
> This is mainly to avoid passing an array key from those functions to a
> callback function that has an optional second parameter, which is not
> intended to get a key string. In practice this is what most people
> would expect would happen, but we're calling it out explicitly. (I'm
> not even sure it's a behavior change from what we had before, in
> practice.)
>
> cf:
>
> https://wiki.php.net/rfc/partial_function_application_v2#extraneous_arguments
>
> It seems the discussion has quieted down and wasn't particularly
> contentious to begin with (whew), so we're just about ready for a vote.
> However, Arnaud went on vacation and didn't remember to tell me when
> he'd be back. :-) So I'm going to wait a few more days just in case he
> has any last minute comments, but start the vote either when he returns
> or Monday the 28th, whichever comes first. (That gets the vote
> complete before the deadline for 8.5.)
>
> --Larry Garfield
Hi folks. Arnaud and I have decided to hold off on the PFA vote for a while to give time to address
late-arriving questions and finish off the implementation. That means it's now pushed to 8.6,
and I've updated the RFC accordingly. We're not pausing though, so expect another update
soon-ish. Meanwhile, if anyone else wants to weigh in on the trailing args question or
repositioning parameters question, now is the time.
--Larry Garfield