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
When substr() takes a nestedsprintf() call as its first argument, the inner formatted string is not passed correctly. The outer substr sees a corrupted subject and returns the wrong tail.
Breaks common file-mode formatting: substr(sprintf('%o', fileperms($f)), -4) should yield 0644, not -4.
Root cause: php-cfg lowers substr(sprintf(...), -N) as adjacent producers [sprintf, UnaryMinus, substr]. isSiblingMultiArgFuncCallProducer rejected sprintf when a unary prelude sat between it and substr, so the inner sprintf return never wired to substr arg 0.
Fix: allow unary-prelude siblings and map distance-2 FuncCall producers to consumer arg 0 in lib/Compiler.php.
Activity
PurHur commentedon Jun 23, 2026
claim: worker-lane-c — starting this run (VM nested builtin call bridge; not ext/standard-only scope)
Fix nested substr(sprintf()) losing inner return value (#10673). (#10685
PurHur commentedon Jun 23, 2026
Merged via #10685.
Root cause: php-cfg lowers
substr(sprintf(...), -N)as adjacent producers[sprintf, UnaryMinus, substr].isSiblingMultiArgFuncCallProducerrejectedsprintfwhen a unary prelude sat between it andsubstr, so the innersprintfreturn never wired tosubstrarg 0.Fix: allow unary-prelude siblings and map distance-2 FuncCall producers to consumer arg 0 in
lib/Compiler.php.Verification (green):
Fix substr() nested string builtin + negative offset arg wiring (#13616…
Merge origin/master into agent/issue-11336-date-sun-info-inline-strto…
PurHur commentedon Jul 4, 2026
claim: cursor-agent-lane-b — regression re-open: substr(sprintf(...), -N) misbind on master (InlineCallArgProducerSlotTest red)