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
The object returned by a closure call whose result is discarded ($k();) is not released at the statement: its destructor runs at shutdown #97
The object returned by a closure call whose result is discarded ($k();) is not released at the statement: its destructor runs at shutdown.
Repro
<?phpfinalclass P { publicfunction__destruct() { echo"dtor\n"; } }
$k = function (): P { returnnewP(); };
$k();
echo"after call\n";
Expected (php)
dtor
after call
Actual (manticore 9ef47219, Darwin arm64)
after call
dtor
Tracking
Known-bug repro: tests/aot/repro/wrong/discarded_closure_result_not_released.php — bash tests/aot/xfail.sh -k discarded_closure_result_not_released reports XFAIL while this is open and XPASS once it is fixed; then move the repro into tests/aot/cases/ and close this issue.
Not fixed on ds on purpose: the release of a discarded call result is decided in InsertMemoryOps, which the ownership branch (ownership-2) replaces almost entirely. Re-check after that lands — the repro stays in tests/aot/repro/wrong/.
Activity
blacktrs commentedon Oct 5, 2026
Not fixed on
dson purpose: the release of a discarded call result is decided inInsertMemoryOps, which the ownership branch (ownership-2) replaces almost entirely. Re-check after that lands — the repro stays intests/aot/repro/wrong/.