Skip to content

AOT: PHPUnit dual QUERY_STRING on one compiled binary (no recompile) #244

@PurHur

Description

@PurHur

Problem

test/aot/ExampleWebAotTest.php compiles examples/001-SimpleWeb/example.php with -q name=Example and runs once. #49 tracks full runtime superglobal population; we lack a regression test that proves the same AOT binary honors different QUERY_STRING values without re-running bin/compile.php.

lib/AOT/runtime/superglobals_refresh.c and phpc serve --aot suggest partial runtime refresh; this issue makes the behavior testable and blocks closing #49.

Goal

One compiled binary, two invocations, two different HTML bodies:

QUERY_STRING='name=Alice' ./simpleweb | grep 'Hello Alice'
QUERY_STRING='name=Bob'   ./simpleweb | grep 'Hello Bob'

Scope

  • Extend ExampleWebAotTest (or new RuntimeSuperglobalsAotTest case) to compile without -q when runtime path is ready
  • Run binary twice with different QUERY_STRING / env; assert distinct output
  • Document failure mode when superglobals are still compile-time baked
  • Wire into @group llvm (Docker: php-compiler:22.04-dev with /opt/llvm9)

Acceptance criteria

Verification (local only)

make docker-build-22
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
  vendor/bin/phpunit --group llvm --filter ExampleWebAotTest

Do not require GitHub Actions.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:webWeb / CGI / superglobalsenhancementNew feature or requestphase-1:web-runtimePhase 1 – CGI/web runtimephase-3:aotPhase 3 – AOT deployment

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions