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
A closure literal in an arm of a conditional callee is never released: ($f ?? function () {...})() keeps the env and its captures alive. #590
A closure literal in an arm of a conditional callee is never released: ($f ?? function () {...})() keeps the env and its captures alive.
Repro
<?phpclass H { publicfunction__destruct() { echo"drop\n"; } }
class F {
publicstatic ?Closure$f = null;
publicstaticfunctionrun() { $k = newH(); return (static::$f ?? function () use ($k) { return1; })(); }
}
F::run();
echo"end\n";
Expected (php)
drop
end
Actual (manticore 823c14a7, Darwin arm64)
end
drop
Tracking
Known-bug repro: tests/aot/repro/leak/closure_literal_arm_of_conditional_callee.php — bash tests/aot/xfail.sh -k closure_literal_arm_of_conditional_callee reports XFAIL while this is open and XPASS once it is fixed; then move the repro into tests/aot/cases/ and close this issue.
Activity