Skip to content

Stdlib: getallheaders() JIT/AOT from sg_SERVER#378

Merged
PurHur merged 3 commits into
masterfrom
agent/stdlib-getallheaders-jit
May 20, 2026
Merged

Stdlib: getallheaders() JIT/AOT from sg_SERVER#378
PurHur merged 3 commits into
masterfrom
agent/stdlib-getallheaders-jit

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented May 20, 2026

Summary

  • Implement getallheaders() for JIT/AOT by emitting LLVM that copies HTTP_* / CONTENT_* keys from the baked sg_SERVER hashtable (same header-name mapping as VM via Superglobals::serverKeyToHeaderName()).
  • Add JitGetallheaders helper and wire getallheaders_::call(); extend JIT::assignOperand() to box hashtable returns into __value__.
  • Add compliance JIT PHPT and AOT fixture; update capability matrix (JIT / AOT yes).

Closes #307

Test plan

  • php bin/vm.php with HTTP_X_TEST / HTTP_HOST env → yes / example.test
  • php script/capability-matrix.php --check
  • vendor/bin/phpunit test/unit/Web/SuperglobalsHttpHeadersTest.php
  • vendor/bin/phpunit test/compliance/JITTest.php (requires LLVM 9 + source script/php-env.sh in php-compiler:22.04-dev)
  • ./script/docker-ci-local.sh full suite (VM phase; harness may skip unrelated language PHPT failures)

Made with Cursor

PurHur and others added 3 commits May 20, 2026 16:13
Emit LLVM that copies HTTP_* and CONTENT_* entries from the baked sg_SERVER
hashtable at compile time, with VM parity unchanged and compliance PHPT coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve bootstrap-inventory.md conflict; keep getallheaders JIT/AOT work.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keeps ci-local.sh --check green on the getallheaders JIT/AOT branch.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit a96082e into master May 20, 2026
1 check passed
@PurHur PurHur deleted the agent/stdlib-getallheaders-jit branch May 20, 2026 16:55
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.

Stdlib: getallheaders() — request headers as associative array

1 participant