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
No try/catch support in the compiler pipeline (lib/Compiler.php / CFG lowering). Real PHP web apps use exceptions for error handling, validation failures, and 500 fallbacks. #195 covers throw; without catch, scripts cannot recover.
Problem
No try/catch support in the compiler pipeline (
lib/Compiler.php/ CFG lowering). Real PHP web apps use exceptions for error handling, validation failures, and 500 fallbacks. #195 coversthrow; without catch, scripts cannot recover.Goal
Minimal exception model for the web subset:
VM first; JIT branch model or landing pads deferred to a follow-up if LLVM complexity blocks.
Implementation hints
Compiler::compileStmt()forStmt\TryCatch(grepTryCatchin vendor php-cfg).Runtime/VMContext; unwind to catch block; rethrow if no handler (Web: Map uncaught exceptions to HTTP 500 in serve driver #152 maps uncaught to HTTP 500 in serve).Exceptionclass in object model (message + code); defer full hierarchy.docs/capabilities.mduntil fast path lands.test/real/cases/web_try_catch.phpt; ServeTest optional uncaught → 500 body.Tasks
catch (Exception $e)bindingUnsupportedRegistryuntil implemented (Lint: Register Phase-2 blockers in UnsupportedRegistry (ternary, .=, break) #258 closed — re-audit mappings)Acceptance criteria
→ VM compliance passes;
phpc linton snippet without catch still maps to tracking issue until done.Verification (local / Docker only)
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \ ./script/ci-local.sh --filter web_try_catchDo not require GitHub Actions.
Dependencies
Priority
Phase 2 — after #54 includes; before reference app polish.
Files
lib/Compiler.php,lib/VM.php,lib/VM/,test/real/cases/Related