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
file-scope use(&$x): overwriting $x inside the closure must destroy the old object at once; native destroys it only at shutdown #69
area:refsReference cells / by-ref semanticsarea:typesType inference / representation / VRAbugSomething isn't workingneeds-designNeeds a design/epic, not a local fixwrong-answerCompiles and runs, output differs from php
file-scope use(&$x): overwriting $x inside the closure must destroy the old object at once; native destroys it only at shutdown.
Repro
<?php// item: 15class D { function__construct(publicstring$n) {} function__destruct() { echo"dtor {$this->n}\n"; } }
$x = newD("x");
$inc = function () use (&$x) { $x = newD("x2"); };
$inc();
echo"end\n";
Expected (php)
dtor x
end
dtor x2
Actual (manticore 09cb49fb, Darwin arm64)
end
dtor x
dtor x2
Tracking
Known-bug repro: tests/aot/repro/wrong/byref_capture_overwrite_dtor_late.php — bash tests/aot/xfail.sh -k byref_capture_overwrite_dtor_late reports XFAIL while this is open and XPASS once it is fixed; then move the repro into tests/aot/cases/ and close this issue.
Scope: erased by-ref channel. Inside the closure the by-ref captured variable (use (&$x), file scope) is an erased unknown param, so the store has no representation flavor to release the OLD value with; the old object lives until shutdown. Fix needs the by-ref capture to carry a self-describing/typed channel (same family as #59 and 'erased/aliased channel NOT self-describing'). Found in batch B; skipped.
area:refsReference cells / by-ref semanticsarea:typesType inference / representation / VRAbugSomething isn't workingneeds-designNeeds a design/epic, not a local fixwrong-answerCompiles and runs, output differs from php
Activity
blacktrs commentedon Oct 13, 2026
Scope: erased by-ref channel. Inside the closure the by-ref captured variable (
use (&$x), file scope) is an erasedunknownparam, so the store has no representation flavor to release the OLD value with; the old object lives until shutdown. Fix needs the by-ref capture to carry a self-describing/typed channel (same family as #59 and 'erased/aliased channel NOT self-describing'). Found in batch B; skipped.Fix the bug backlog: coercion, references, crashes, uninitialised typ…