You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Arrow functions don't capture variables used only in partial application arguments #25733
An arrow function does not capture a variable that it uses only in the bound arguments of a partial application. The variable is undefined inside the arrow function, so the partial application binds null.
Warning: Undefined variable $a in /in/X on line 9
string(2) " b"
Warning: Undefined variable $a in /in/X on line 10
string(2) " b"
But I expected this output instead:
string(3) "a b"
string(3) "a b"
The equivalent closure fn() => array_map(fn($b) => f($a, $b), ['b'])[0] and a long closure with use ($a) both work. The same happens with methods, static methods, named and variadic placeholders, and with OPcache on or off.
Activity
iliaal commentedon Nov 25, 2026
Fixed by 25732