Skip to content

JIT: isset/empty on runtime-populated sg_GET keys (close #49 JIT slice) #1901

Description

@PurHur

Problem

#49 umbrella remains open for JIT paths where SuperglobalInit still folds literal keys at compile time. #70 / #86 closed literal-key isset; apps using dynamic keys still fail JIT:

$key = 'name';
if (isset($_GET[$key])) { echo $_GET[$key]; }

IssetHelper / lib/JIT/Builtin/IssetHelper.php must call __hashtable__offsetIsSet on sg_GET / sg_POST when the key is non-constant.

Goal

Implementation hints

Layer Files
Isset lib/JIT/Builtin/IssetHelper.php
Empty lib/JIT.php empty lowering
Tests test/aot/JitSuperglobalRefreshTest.php
AOT already linked superglobals_refresh.c

Acceptance criteria

./script/ci-local.sh --filter 'web_isset_dynamic|JitSuperglobal'
php bin/jit.php -q 'name=Alice' -r 'echo isset($_GET["name"]) ? $_GET["name"] : "no";'
# → Alice (key via variable index)

Verification (local / Docker only)

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

Dependencies

Links

Activity

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