Skip to content

AOT: require-as-expression fixture (config.php return array pattern, #783) #806

@PurHur

Description

@PurHur

Problem

examples/003-MiniWebApp/public/index.php bootstraps with:

$config = require __DIR__ . '/../config.php';

#783 tracks project-level AOT execute for this pattern; #752 ✅ proves multi-TU link works. There is no focused @group aot-link fixture that isolates require as an expression (return value from an included file) without the full Router graph.

Regressions in require-return lowering are hard to bisect inside the 003 tree.

Goal

test/fixtures/aot/cases/require_return_config.phpt passes AOT lint + link + execute:

  • entry.php assigns $cfg = require 'config.php';
  • config.php returns ['app_name' => 'FixtureApp'];
  • stdout contains FixtureApp

Scope

  • Fixture directory under test/fixtures/aot/cases/require_return_config/
  • PHPT in @group aot-link (and execute when LLVM ready)
  • Document relationship to manifest_includes.phpt (link order) vs this issue (runtime return value)

Implementation hints

Area Files Notes
Compiler lib/Compiler.php require expr lowering vs statement
AOT lib/AOT/ Compare VM lib/VM.php stack for include return
Reference examples/003-MiniWebApp/config.php Same return-array shape
Parent #783, blocker umbrella #764 Land fixture before or with project fix

Reproduce (after fixture exists)

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

On harness hosts with empty bind-mount: ./script/docker-ci-local.sh --filter require_return_config.

Acceptance criteria

Dependencies

Links

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions