Web: dynamic isset() on $_GET/$_POST in JIT (#70)#418
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
isset($_GET[$key])/isset($_POST[$key])with non-literal string keys to__hashtable__offsetIsSetStringKeyinIssetHelperinstead of rejecting at compile time.SuperglobalInit::compileTimeOffsetIsSet.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 duringbin/compile.phplink (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(Dockerphp-compiler:22.04-dev)vendor/bin/phpunit test/real/RealWorldTest.php --filter testCases#37./script/docker-ci-local.shon maintainer host (VM stage covers new PHPTs; JIT stage skipped when MCJIT probe fails)Closes #70
Made with Cursor