Re: [Vote] Partial Function Application v2
| From: | Tim Düsterhus | Date: | Mon, 09 Feb 2026 21:09:41 +0000 |
| Subject: | Re: [Vote] Partial Function Application v2 | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-130064@lists.php.net to get a copy of this message | ||
Hi
On 11/20/25 22:59, Larry Garfield wrote:
https://wiki.php.net/rfc/partial_function_application_v2As 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