Problem
#201 ✅ closed AOT per-request superglobal refresh via lib/AOT/runtime/superglobals_refresh.c. #49 remains open for the JIT path: lib/JIT/SuperglobalInit.php still bakes sg_GET / sg_POST at compile/init time when env changes between runs of the same JIT artifact.
bin/jit.php with different -q / -p on back-to-back invocations can return stale $_GET / $_POST unless the VM pre-populates and JIT re-reads.
Goal
JIT standalone runs match VM behavior: each process invocation refreshes superglobals from QUERY_STRING, REQUEST_BODY, and related CGI env before user code.
Implementation hints
| Area |
Files |
| Init hook |
lib/JIT/SuperglobalInit.php — call refresh before main |
| Env parse |
Reuse lib/Web/Superglobals.php from VM (port or FFI) |
| CLI |
bin/jit.php — pass -q/-p into env map each run |
| Tests |
Extend test/unit/RuntimeSuperglobalRefreshTest.php or new @group llvm JIT PHPT |
Acceptance criteria
php bin/jit.php -q 'name=Alice' examples/001-SimpleWeb/example.php | grep Alice
php bin/jit.php -q 'name=Bob' examples/001-SimpleWeb/example.php | grep Bob
No recompile between runs; outputs differ.
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
./script/ci-local.sh --filter Superglobal
Dependencies
Verification
Local/Docker only — do not require .github/workflows/*.
Links
Problem
#201 ✅ closed AOT per-request superglobal refresh via
lib/AOT/runtime/superglobals_refresh.c. #49 remains open for the JIT path:lib/JIT/SuperglobalInit.phpstill bakessg_GET/sg_POSTat compile/init time when env changes between runs of the same JIT artifact.bin/jit.phpwith different-q/-pon back-to-back invocations can return stale$_GET/$_POSTunless the VM pre-populates and JIT re-reads.Goal
JIT standalone runs match VM behavior: each process invocation refreshes superglobals from
QUERY_STRING,REQUEST_BODY, and related CGI env before user code.Implementation hints
lib/JIT/SuperglobalInit.php— call refresh beforemainlib/Web/Superglobals.phpfrom VM (port or FFI)bin/jit.php— pass-q/-pinto env map each runtest/unit/RuntimeSuperglobalRefreshTest.phpor new@group llvmJIT PHPTAcceptance criteria
No recompile between runs; outputs differ.
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \ ./script/ci-local.sh --filter SuperglobalDependencies
Verification
Local/Docker only — do not require
.github/workflows/*.Links
examples/001-SimpleWeb/