I hereby open the vote on Partial Function Application:
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.)
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:
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:
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)?
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.