Problem
Modern PHP web code relies heavily on ?? for defaults:
$ name = $ _GET ['name ' ] ?? 'Guest ' ;
$ action = $ _POST ['action ' ] ?? 'index ' ;
If Op\Expr\Coalesce (or equivalent in php-cfg) is not lowered, compilation throws Unsupported expression from lib/Compiler.php.
Goal
Support ?? in CFG → opcodes → VM → JIT.
Tasks
Acceptance criteria
bin/vm.php, bin/jit.php, and bin/compile.php compile and run scripts using ?? with same output as PHP 8.
Related
Status on master (May 2026)
Layer
Status
Evidence
Compiler
✅
lib/Compiler.php — compileCoalesce(), Expr\BinaryOp\Coalesce, ??= assign
VM
✅
test/compliance/cases/language/coalesce.phpt, coalesce_assign.phpt
JIT
🚧 partial
lib/JIT/CoalesceHelper.php; coalesce_assign_jit.phpt; spine requires helper
AOT
✅ fixtures
test/fixtures/aot/cases/coalesce_*.phpt (MiniWebApp bisect ladder)
Lint
✅
UnsupportedRegistry no longer tracks Expr_AssignOp_Coalesce
CI gate
📋
Dedicated gate tracked in #1960
Remaining before closing #99
Audit JIT gaps: superglobal ?? chains, nested ?? with side effects
Land CI: COALESCE_COMPLIANCE_GATE default-on in ci-fast (audit + close #99) #1960 COALESCE_COMPLIANCE_GATE=1 in ci-fast.sh
Confirm bin/jit.php + bin/compile.php parity on coalesce_get_default.phpt
Implementation hints (JIT gaps)
Case
Files
Superglobal default
lib/Compiler.php + SuperglobalCoalesceVmTest
Branch targets
lib/JIT/CoalesceHelper.php
Assign coalesce
lib/JIT.php
Verification (local / Docker only)
./script/ci-fast.sh --filter Coalesce
COALESCE_COMPLIANCE_GATE=1 ./script/ci-fast.sh --filter Coalesce # after #1960
docker run --rm -v " $( pwd) :/compiler" -w /compiler php-compiler:22.04-dev \
./script/ci-fast.sh --filter Coalesce
Dependencies (updated)
Links
Problem
Modern PHP web code relies heavily on
??for defaults:If
Op\Expr\Coalesce(or equivalent in php-cfg) is not lowered, compilation throwsUnsupported expressionfromlib/Compiler.php.Goal
Support
??in CFG → opcodes → VM → JIT.Tasks
Compiler::compileExprtest/real/cases/coalesce_get_default.phptAcceptance criteria
bin/vm.php,bin/jit.php, andbin/compile.phpcompile and run scripts using??with same output as PHP 8.Related
Status on master (May 2026)
lib/Compiler.php—compileCoalesce(),Expr\BinaryOp\Coalesce,??=assigntest/compliance/cases/language/coalesce.phpt,coalesce_assign.phptlib/JIT/CoalesceHelper.php;coalesce_assign_jit.phpt; spine requires helpertest/fixtures/aot/cases/coalesce_*.phpt(MiniWebApp bisect ladder)UnsupportedRegistryno longer tracksExpr_AssignOp_CoalesceRemaining before closing #99
??chains, nested??with side effectsCOALESCE_COMPLIANCE_GATE=1inci-fast.shbin/jit.php+bin/compile.phpparity oncoalesce_get_default.phptImplementation hints (JIT gaps)
lib/Compiler.php+SuperglobalCoalesceVmTestlib/JIT/CoalesceHelper.phplib/JIT.phpVerification (local / Docker only)
Dependencies (updated)
??defaultsLinks