Skip to content

AOT: nested $_GET/$_POST query parsing for static web apps (#200)#230

Merged
PurHur merged 1 commit into
masterfrom
feat/aot-nested-superglobals-200
May 18, 2026
Merged

AOT: nested $_GET/$_POST query parsing for static web apps (#200)#230
PurHur merged 1 commit into
masterfrom
feat/aot-nested-superglobals-200

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented May 18, 2026

Summary

  • Parse bracket-style query and POST bodies (user[name]=Ada, tags[]=a) in the AOT runtime __superglobals__refresh path, with URL decoding aligned to VM parse_str.
  • Add LLVM hashtable helpers (__hashtable__setStringKeyHashtable, __value__read/writeHashtable, etc.) and copy nested superglobals at AOT compile time via SuperglobalInit.
  • Fix Docker local CI: install libbsd0 so bundled LLVM 9 loads in php:8.2-cli-bookworm; enable Composer plugins for capability-matrix.

Test plan

  • ./script/docker-ci.shNestedSuperglobalsAotTest and ExampleWebAotTest pass (llvm group)
  • AOT PHPT nested_get_params.phpt (flat key with nested QUERY_STRING)
  • Follow-up: compiled access to $_GET['user']['name'] in LLVM (boxed array dim-fetch)

Notes

VM already supports nested params (issue #200). This PR wires the same semantics into static AOT binaries when QUERY_STRING / REQUEST_BODY are refreshed per request (phpc serve --aot). Chained $_GET['a']['b'] in generated code is a separate JIT follow-up.

Made with Cursor

Bracket notation (user[name]=, tags[]=) is parsed in the AOT runtime C
refresh path with URL decoding, matching VM parse_str behavior. LLVM
hashtable helpers support nested child tables; SuperglobalInit copies
nested arrays at compile time. Docker CI installs libbsd0 so bundled
LLVM loads in php:8.2-cli-bookworm.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit f3cf66d into master May 18, 2026
@PurHur PurHur deleted the feat/aot-nested-superglobals-200 branch May 18, 2026 19:02
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.

1 participant