Skip to content

Web: dynamic isset() on $_GET/$_POST in JIT (#70)#418

Merged
PurHur merged 1 commit into
masterfrom
fix/issue-70-dynamic-isset-superglobals
May 20, 2026
Merged

Web: dynamic isset() on $_GET/$_POST in JIT (#70)#418
PurHur merged 1 commit into
masterfrom
fix/issue-70-dynamic-isset-superglobals

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented May 20, 2026

Summary

  • Lower isset($_GET[$key]) / isset($_POST[$key]) with non-literal string keys to __hashtable__offsetIsSetStringKey in IssetHelper instead of rejecting at compile time.
  • Literal keys still use the existing compile-time fold via SuperglobalInit::compileTimeOffsetIsSet.
  • Add VM compliance PHPT (isset_get_dynamic_key) and real-world PHPT (web_isset_get_dynamic_key).

Why

Reference apps and routers need isset($_GET[$param]) when the key comes from a variable (route name, form field id, etc.). Issue #70.

AOT note

isset($_GET[...]) still segfaults during bin/compile.php link (reproduces on master with literal keys too). No AOT fixture added until that is fixed separately.

Test plan

  • vendor/bin/phpunit test/compliance/VMTest.php --filter testCases#154 (Docker php-compiler:22.04-dev)
  • vendor/bin/phpunit test/real/RealWorldTest.php --filter testCases#37
  • Full ./script/docker-ci-local.sh on maintainer host (VM stage covers new PHPTs; JIT stage skipped when MCJIT probe fails)

Closes #70

Made with Cursor

Lower non-literal superglobal keys to __hashtable__offsetIsSetStringKey
at compile time so routers can use isset($_GET[$param]) under JIT.
Add VM compliance and real PHPT coverage; AOT isset on superglobals
still segfaults at link (pre-existing, tracked separately).

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit 01056e4 into master May 20, 2026
@PurHur PurHur deleted the fix/issue-70-dynamic-isset-superglobals branch May 20, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web: Dynamic isset/empty on $_GET and $_POST keys in JIT

1 participant