Problem
#54 closed with AOT literal-path bundling via LiteralIncludeDiscovery + SourceBundler in bin/compile.php. JIT still throws on OpCode::TYPE_INCLUDE:
// lib/JIT.php — TYPE_INCLUDE
throw new \LogicException('include/require must be resolved before AOT compile …');
examples/003-MiniWebApp/ needs multi-file execution in all three modes (VM ✅, AOT bundle ✅, JIT ❌). phpc serve JIT mode (#207) and compliance JIT tests for two-file apps remain blocked.
Goal
include / require with static path expressions (__DIR__ . '/file.php', string literal) compile in JIT the same way AOT bundles them today — no runtime TYPE_INCLUDE in generated LLVM for v1.
Dynamic include $path stays out of scope (document in docs/capabilities.md).
Implementation hints
| Approach |
Files |
Notes |
| Reuse bundler |
lib/AOT/LiteralIncludeDiscovery.php, SourceBundler |
Share discovery from entry / current function |
| JIT compile |
lib/JIT.php |
Lower bundled units as nested functions or inlined blocks |
| Compiler |
lib/Compiler.php |
Optionally replace TYPE_INCLUDE with bundled symbol refs at compile time |
| Once |
#120 |
Dedup table at JIT module scope |
| Tests |
test/compliance/cases/include_two_file_jit.phpt |
Mirror VM two-file fixture |
Acceptance criteria
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
php bin/jit.php examples/003-MiniWebApp/public/index.php
Does not throw on TYPE_INCLUDE (may still fail on #58/#145 until OOP lands).
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
./script/ci-local.sh --filter include_two_file
Verification (local / Docker only)
No GitHub Actions required.
Dependencies
Related
Problem
#54 closed with AOT literal-path bundling via
LiteralIncludeDiscovery+SourceBundlerinbin/compile.php. JIT still throws onOpCode::TYPE_INCLUDE:examples/003-MiniWebApp/needs multi-file execution in all three modes (VM ✅, AOT bundle ✅, JIT ❌).phpc serveJIT mode (#207) and compliance JIT tests for two-file apps remain blocked.Goal
include/requirewith static path expressions (__DIR__ . '/file.php', string literal) compile in JIT the same way AOT bundles them today — no runtimeTYPE_INCLUDEin generated LLVM for v1.Dynamic
include $pathstays out of scope (document indocs/capabilities.md).Implementation hints
lib/AOT/LiteralIncludeDiscovery.php,SourceBundlerlib/JIT.phplib/Compiler.phpTYPE_INCLUDEwith bundled symbol refs at compile timetest/compliance/cases/include_two_file_jit.phptAcceptance criteria
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \ php bin/jit.php examples/003-MiniWebApp/public/index.phpDoes not throw on
TYPE_INCLUDE(may still fail on #58/#145 until OOP lands).docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \ ./script/ci-local.sh --filter include_two_fileVerification (local / Docker only)
No GitHub Actions required.
Dependencies
__DIR__for path resolutionrequire_oncededupRelated
--projectgraph (AOT UX)