# [Vote] Partial Function Application v2

- Thread: https://externals.io/message/129349
- Original archive: https://news-web.php.net/php.internals/129349
- Started by Larry Garfield on 2025-11-20T21:59:11+00:00
- Messages: 5
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #129349 — Larry Garfield — 2025-11-20T21:59:11+00:00

URL: https://externals.io/message/129349#129349

I hereby open the vote on Partial Function Application:

https://wiki.php.net/rfc/partial_function_application_v2

The vote will be open for a little over 2 weeks, automatically closing at 2025-12-05 T 12:00:00, UTC.  (That's 2 weeks and a couple hours, just to be safe.)

-- 
  Larry Garfield
  larry@garfieldtech.com

---

## #129350 — Larry Garfield — 2025-11-20T22:09:38+00:00

URL: https://externals.io/message/129349#129350 · In reply to: #129349

> I hereby open the vote on Partial Function Application:
>
> https://wiki.php.net/rfc/partial_function_application_v2
>
> The vote will be open for a little over 2 weeks, automatically closing 
> at 2025-12-05 T 12:00:00, UTC.  (That's 2 weeks and a couple hours, 
> just to be safe.)
>
> -- 
>   Larry Garfield
>   larry@garfieldtech.com

And as requested off-list, the discussion thread is here:

https://externals.io/message/127781

--Larry Garfield

---

## #129565 — Larry Garfield — 2025-12-05T15:43:00+00:00

URL: https://externals.io/message/129349#129565 · In reply to: #129350

> 
> > […]
>
> And as requested off-list, the discussion thread is here:
>
> https://externals.io/message/127781
>
> --Larry Garfield

The vote has now closed.  The RFC is adopted unanimously 33-0-0.

Thanks, everyone!  We'll get the PR merged soonish.  PHP 8.6 is off to a great start. :-)

--Larry Garfield

---

## #130064 — tim@bastelstu.be — 2026-02-09T21:09:41+00:00

URL: https://externals.io/message/129349#130064 · In reply to: #129349

Hi


> https://wiki.php.net/rfc/partial_function_application_v2

As part of my work on the PFA-for-$this RFC I noticed one thing that is 
left undefined in the RFC text and AFAICT not currently tested with the 
implementation PR, but appears to “just work” is late-static binding 
with `static::`:

     <?php

     class P {
         public static function m(string $a): void {
             echo __METHOD__, PHP_EOL;
             var_dump($a);
         }

         public static function get() {
             return static::m(?);
         }
     }

     class C extends P {
         public static function m(string|array $b): void {
             echo __METHOD__, PHP_EOL;
             var_dump($b);
         }
     }

     P::get()(a: 'a');
     C::get()(b: []);

This correctly results in:

     P::m
     string(1) "a"
     C::m
     array(0) {
     }

being output.

Can you please make sure to include this as an Erratum within the RFC 
text (and also make sure it gets a proper test in the PR, including all 
possible OPcache variations)?

Best regards
Tim Düsterhus

---

## #130068 — Larry Garfield — 2026-02-11T00:02:51+00:00

URL: https://externals.io/message/129349#130068 · In reply to: #130064

> Hi
>
> 
> > […]
>
> As part of my work on the PFA-for-$this RFC I noticed one thing that is 
> left undefined in the RFC text and AFAICT not currently tested with the 
> implementation PR, but appears to “just work” is late-static binding 
> with `static::`:
>
>      <?php
>
>      class P {
>          public static function m(string $a): void {
>              echo __METHOD__, PHP_EOL;
>              var_dump($a);
>          }
>
>          public static function get() {
>              return static::m(?);
>          }
>      }
>
>      class C extends P {
>          public static function m(string|array $b): void {
>              echo __METHOD__, PHP_EOL;
>              var_dump($b);
>          }
>      }
>
>      P::get()(a: 'a');
>      C::get()(b: []);
>
> This correctly results in:
>
>      P::m
>      string(1) "a"
>      C::m
>      array(0) {
>      }
>
> being output.
>
> Can you please make sure to include this as an Erratum within the RFC 
> text (and also make sure it gets a proper test in the PR, including all 
> possible OPcache variations)?
>
> Best regards
> Tim Düsterhus

Thanks Tim, good catch.  I have added an errata to that effect; Arnaud's on vacation this week but will add some tests when he returns.

--Larry Garfield
