Problem
examples/007-ThrowsWeb/example.php uses an empty user class ValidationError with throw new ValidationError() / catch (ValidationError $e). VM + phpc serve are green (#2076 ✅, #2084 ✅).
Native AOT link/execute still skips in ThrowsWebAotExecuteTest / ExamplesCompileTest::test007ThrowsWebAotLink via PhpcBuild::isUserClassAotBlocked() — gates #2101 ✅ wired but THROWSWEB_AOT_* remain opt-in (#2135).
This is the language blocker for 007 AOT, distinct from gate-flip issues.
Goal
THROWSWEB_AOT_LINK_GATE=1 ./phpc build --project examples/007-ThrowsWeb
THROWSWEB_AOT_SMOKE_GATE=1 vendor/bin/phpunit --filter ThrowsWebAotExecute
Both green on php-compiler:22.04-dev without skip messages.
Implementation hints
| Layer |
Files |
Notes |
| AOT compile |
lib/AOT/, lib/Compiler.php |
Lower empty class + new + throw + typed catch |
| Objects |
lib/JIT/Builtin/Type/Object_.php, linker |
Avoid __object__ unsupported native type for empty classes |
| Try/catch |
lib/JIT/TryCatchHelper.php (AOT path) |
Reuse VM lowering from #2084 |
| Lint |
lib/Lint/UnsupportedRegistry.php |
Allow empty class in project entry |
| Tests |
test/unit/ThrowsWebAotExecuteTest.php |
Remove skip when build succeeds |
Minimal v1 scope
Acceptance criteria
Verification (local / Docker only)
make docker-build-22
./script/docker-exec.sh -- bash -lc '
source script/php-env.sh
THROWSWEB_AOT_LINK_GATE=1 THROWSWEB_AOT_SMOKE_GATE=1 \
vendor/bin/phpunit --filter ThrowsWebAotExecute
'
Do not require GitHub Actions.
Dependencies
Links
Problem
examples/007-ThrowsWeb/example.phpuses an empty user classValidationErrorwiththrow new ValidationError()/catch (ValidationError $e). VM +phpc serveare green (#2076 ✅, #2084 ✅).Native AOT link/execute still skips in
ThrowsWebAotExecuteTest/ExamplesCompileTest::test007ThrowsWebAotLinkviaPhpcBuild::isUserClassAotBlocked()— gates #2101 ✅ wired butTHROWSWEB_AOT_*remain opt-in (#2135).This is the language blocker for 007 AOT, distinct from gate-flip issues.
Goal
Both green on
php-compiler:22.04-devwithout skip messages.Implementation hints
lib/AOT/,lib/Compiler.phpnew+throw+ typedcatchlib/JIT/Builtin/Type/Object_.php, linker__object__unsupported native type for empty classeslib/JIT/TryCatchHelper.php(AOT path)lib/Lint/UnsupportedRegistry.phptest/unit/ThrowsWebAotExecuteTest.phpMinimal v1 scope
example.phponly) — no methods onValidationErrorExceptionbuiltin later; 007 only needs user empty classAcceptance criteria
phpc build --project examples/007-ThrowsWebexits 0 with LLVM 9email=badprintsinvalid(case-insensitive)ThrowsWebAotExecuteTestruns (not skipped) whenTHROWSWEB_AOT_SMOKE_GATE=1Verification (local / Docker only)
Do not require GitHub Actions.
Dependencies
Links
examples/007-ThrowsWeb/