Problem
#471 closed documenting that include must inherit the caller scope (layout → partial templates). There is no compliance PHPT in test/compliance/cases/ and no CI filter include_scope.
examples/003-MiniWebApp/templates/layout.php sets $title then includes home.php — silent breakage if a future refactor isolates included file scope.
Goal
Add test/compliance/cases/include_scope_inherit.phpt (VM + JIT when #474 lands):
$title = 'Home';
include __DIR__ . '/partial.php'; // echoes $title
Assert VM and JIT output matches Zend.
Implementation hints
| Area |
Notes |
| VM |
lib/VM.php TYPE_INCLUDE pushes frame from parseAndCompileFile — verify locals visible in included file |
| Fixture |
test/compliance/fixtures/include_scope/partial.php |
| MiniWebApp |
Optional integration: lint-only until #67; no ServeTest dependency |
Acceptance criteria
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
./script/ci-local.sh --filter include_scope
JUnit/compliance reports pass for include_scope_inherit.phpt.
Verification (local / Docker only)
No GitHub Actions required.
Dependencies
Related
Problem
#471 closed documenting that
includemust inherit the caller scope (layout → partial templates). There is no compliance PHPT intest/compliance/cases/and no CI filterinclude_scope.examples/003-MiniWebApp/templates/layout.phpsets$titlethenincludeshome.php— silent breakage if a future refactor isolates included file scope.Goal
Add
test/compliance/cases/include_scope_inherit.phpt(VM + JIT when #474 lands):Assert VM and JIT output matches Zend.
Implementation hints
lib/VM.phpTYPE_INCLUDEpushes frame fromparseAndCompileFile— verify locals visible in included filetest/compliance/fixtures/include_scope/partial.phpAcceptance criteria
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \ ./script/ci-local.sh --filter include_scopeJUnit/compliance reports pass for
include_scope_inherit.phpt.Verification (local / Docker only)
No GitHub Actions required.
Dependencies
__DIR__Related