Skip to content

AOT: layout partial chain fixture (conditional includes in layout.php, #784) #807

Closed

Description

@PurHur

Problem

examples/003-MiniWebApp/templates/layout.php performs a second include tier — conditional partials based on $title:

if ('Home' === $title) {
    include __DIR__ . '/home.php';
} elseif ('Hello' === $title) {
    include __DIR__ . '/hello.php';
}

#739 ✅ closed method_include_void.phpt (void method + single trailing include). #776 tracks Router render* + first include. #784 tracks the layout branch includes in the full app.

There is no minimal AOT fixture for nested conditional includes inside a layout template — the pattern that differs from a single include in a void method.

Goal

test/fixtures/aot/cases/layout_partial_chain.phpt passes AOT execute with stdout containing a needle from the selected partial (e.g. HomePartial / HelloPartial).

Scope

  • Fixture: layout.php + home.php + hello.php + entry.php calling a void renderer
  • @group aot-link + execute probe
  • Optional: htmlspecialchars() in layout <title> (matches MiniWebApp)

Implementation hints

Piece Notes
Compare method_include_void_array_property/ — adds typed array prop
Compare deploy_include_template/ — deploy path, not branch includes
AOT lib/AOT/ runtime include resolution for __DIR__ in template TU
Parent #784, #764

Reproduce

./script/ci-local.sh --filter layout_partial_chain
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
  ./script/ci-local.sh --filter layout_partial_chain

Acceptance criteria

Dependencies

Links

Activity

  1. PurHur commented on May 23, 2026

    @PurHur
    OwnerAuthor

    Closed via #977 — layout_partial_chain.phpt in miniwebapp-bisect ladder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions