Category
bootstrap | language (AOT link)
Problem
bin/compile.php / phpc build originally emitted one .o per entry file. Multi-file apps need:
public/index.php → require bootstrap.php → src/Router.php
Status (May 2026)
Phase 1 shipped on master:
| Capability |
Issue |
Status |
Manifest includes[] |
#452 |
✅ |
ProjectGraph BFS |
#504 |
✅ |
Multi-.o link |
#752 |
✅ |
| 003-MiniWebApp AOT link + execute |
#764 |
✅ |
| Deploy bundle |
#609 |
✅ |
Phase 2 open — dynamic discovery: #1762 (PSR-4 autoload, non-literal requires). Parent umbrella #59 should narrow to phase-2 or close when static path is documented.
php-src reference
- N/A (AOT linker) — analogous to linking multiple
.o from php-src build + php CLI embedding multiple compilation units
- Include graph: compare Zend OPcache preload /
zend_compile_file per path
Repro — phase 1 (passes today)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/compile.php --project examples/003-MiniWebApp -o /tmp/miniwebapp
/tmp/miniwebapp 2>&1 | head -5
'
003-MiniWebApp with explicit includes[] in phpc.json links and executes (#764 ✅).
Repro — phase 2 gap (#1762)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/compile.php --project test/fixtures/aot/projects/psr4_mini -o /tmp/psr4_mini
'
Expected: green link when autoload discovers src/*.php.
Actual: fixture missing / requires hand includes[].
Goal (phase 2)
phpc build --project discovers PHP files reachable from entry without hand-maintaining every path in phpc.json when uses PSR-4 or static string requires.
Scope (this repo)
| Module |
Path |
| Linker |
lib/AOT/Linker.php — multi-.o symbol merge ✅ |
| Graph |
lib/AOT/ProjectGraph.php — BFS literal includes ✅; extend #1762 |
| Manifest |
lib/Web/ProjectManifest.php, phpc.json schema #1803 |
| Compiler metadata |
lib/Compiler.php — record literal include targets |
| Tests |
test/fixtures/aot/cases/multi_file_include.phpt, test/fixtures/aot/projects/psr4_mini/ |
Discovery graph (phase 2)
Symbol table
Done when
Phase 1 (met):
Phase 2 (this issue stays open until #1762 closes):
Verification (local / Docker only)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && ./script/ci-local.sh --filter AotTest'
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && ./script/ci-local.sh --filter ProjectGraph'
Do not use raw docker run -v "$(pwd):/compiler" on Runforge — use ./script/docker-exec.sh.
Dependencies
Related
Category
bootstrap|language(AOT link)Problem
bin/compile.php/phpc buildoriginally emitted one.oper entry file. Multi-file apps need:Status (May 2026)
Phase 1 shipped on
master:includes[]ProjectGraphBFS.olinkPhase 2 open — dynamic discovery: #1762 (PSR-4 autoload, non-literal requires). Parent umbrella #59 should narrow to phase-2 or close when static path is documented.
php-src reference
.ofrom php-src build +phpCLI embedding multiple compilation unitszend_compile_fileper pathRepro — phase 1 (passes today)
003-MiniWebApp with explicit
includes[]inphpc.jsonlinks and executes (#764 ✅).Repro — phase 2 gap (#1762)
Expected: green link when autoload discovers
src/*.php.Actual: fixture missing / requires hand
includes[].Goal (phase 2)
phpc build --projectdiscovers PHP files reachable from entry without hand-maintaining every path inphpc.jsonwhen uses PSR-4 or static string requires.Scope (this repo)
lib/AOT/Linker.php— multi-.osymbol merge ✅lib/AOT/ProjectGraph.php— BFS literal includes ✅; extend #1762lib/Web/ProjectManifest.php,phpc.jsonschema #1803lib/Compiler.php— record literal include targetstest/fixtures/aot/cases/multi_file_include.phpt,test/fixtures/aot/projects/psr4_mini/Discovery graph (phase 2)
require/includewith compile-time literal paths (Language: include/require in JIT and AOT (multi-file applications) #54 AOT)phpc.json"autoload": { "psr-4": ... }— compile referenced classes (DevEx: PSR-4 autoload paths in phpc.json project manifest #155, AOT: Dynamic require/include discovery for project build (phase 2 of #154) #1762)require $pathSymbol table
mainDone when
Phase 1 (met):
phpc build --project examples/003-MiniWebApplinks + executes (AOT: MiniWebApp native binary CLI execute emits empty stdout (post-link) #764)./script/ci-local.sh --filter AotTestincludes multi-file link casesPhase 2 (this issue stays open until #1762 closes):
phpc build --project test/fixtures/aot/projects/psr4_minigreen without handincludes[]phpc lint --projectreports dynamicrequire $varwith file:linedocs/capabilities.md/ project build docsVerification (local / Docker only)
Do not use raw
docker run -v "$(pwd):/compiler"on Runforge — use./script/docker-exec.sh.Dependencies
__DIR__for relative requiresRelated
lib/AOT/Linker.php,lib/AOT/ProjectGraph.php,lib/Web/ProjectManifest.php