Problem
examples/003-MiniWebApp/src/Router.php uses : void render methods that end with a literal include of layout templates:
private function renderHome(): void
{
$title = 'Home';
include __DIR__ . '/../templates/home.php';
}
#752 ✅ links the project; #764 tracks empty stdout when running .phpc/bin/app. VM/JIT serve prints HTML — the gap is native execute through void methods + nested includes.
#739 covers method_include_void.phpt fixture; this issue tracks the Router-shaped integration path.
Goal
Native binary stdout contains layout HTML (e.g. app_name from config.php) for:
QUERY_STRING=route=home
PATH_INFO=/hello + name=Dev
Implementation hints
| Layer |
Files |
Notes |
| JIT include |
lib/JIT.php IncludeHelper, lib/JIT/Context.php |
Nested compile-time inlining depth (#568 history) |
| AOT |
lib/AOT/ |
Ensure included template TU is linked; echo/buffer not dropped after void return |
| Void returns |
#205 |
: void must not strip trailing include side effects |
| Typed props |
#767 |
private array $config on Router |
| Fixture |
test/fixtures/aot/cases/method_include_void.phpt |
Green before full 003 (#739) |
| Test |
#747 / #485 |
Project-level acceptance |
Reproduce
composer install && ./script/apply-patches.sh
php bin/phpc.php build --project examples/003-MiniWebApp
cd examples/003-MiniWebApp
QUERY_STRING=route=home REQUEST_METHOD=GET ./.phpc/bin/app | wc -c # expect >0; currently 0 (#764)
Docker (tar copy on empty bind-mount):
./script/docker-ci-local.sh --filter method_include_void
Acceptance criteria
Dependencies
Verification
Local/Docker only — ./script/ci-local.sh --filter MiniWebAppAotExecuteTest when #747 exists.
Links
Problem
examples/003-MiniWebApp/src/Router.phpuses: voidrender methods that end with a literalincludeof layout templates:#752 ✅ links the project; #764 tracks empty stdout when running
.phpc/bin/app. VM/JIT serve prints HTML — the gap is native execute through void methods + nested includes.#739 covers
method_include_void.phptfixture; this issue tracks the Router-shaped integration path.Goal
Native binary stdout contains layout HTML (e.g.
app_namefromconfig.php) for:QUERY_STRING=route=homePATH_INFO=/hello+name=DevImplementation hints
lib/JIT.phpIncludeHelper,lib/JIT/Context.phplib/AOT/: voidmust not strip trailing include side effectsprivate array $configon Routertest/fixtures/aot/cases/method_include_void.phptReproduce
Docker (tar copy on empty bind-mount):
Acceptance criteria
method_include_void.phptpasses@group aot-link(AOT: Green method_include_void.phpt and @group aot-link for void+include methods #739)MiniWebAppAotExecuteTesthome route non-empty (Testing: MiniWebAppAotExecuteTest CLI smoke (#485, #676 step 2) #747)wc -c> 0 for home routeDependencies
Verification
Local/Docker only —
./script/ci-local.sh --filter MiniWebAppAotExecuteTestwhen #747 exists.Links