Skip to content

Fix AOT ?? on $_GET and web PHPT expectations#482

Merged
PurHur merged 1 commit into
masterfrom
fix/aot-coalesce-and-web-phpt
May 21, 2026
Merged

Fix AOT ?? on $_GET and web PHPT expectations#482
PurHur merged 1 commit into
masterfrom
fix/aot-coalesce-and-web-phpt

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented May 21, 2026

Summary

  • Fix LLVM/AOT lowering for ?? when the merge block re-initialized hoisted php-cfg temps, wiping branch assignments (empty echo for $_GET['name'] ?? 'Guest').
  • Teach bin/compile.php to fall back to QUERY_STRING / REQUEST_BODY from the environment when -q/-p are not passed (matches PHPT/AotTest compile env).
  • Align AOT PHPTs: coalesce_get_present exercises direct echo $_GET['name'] ?? …; in_array_router_404 expects Status: 404 (runtime header form).

Test plan

Docker (php-compiler:22.04-dev, repo copied via tar):

vendor/bin/phpunit --group aot-link --exclude-group serve
# OK (123 tests, 672 assertions)

Manual:

php bin/compile.php -q name=Ada -o /tmp/coal /tmp/t.php   # echo $_GET['name'] ?? 'Guest'
/tmp/coal   # Ada

Made with Cursor

JIT merge blocks no longer re-init hoisted ?? temps over branch stores; compile.php
reads QUERY_STRING/REQUEST_BODY from the environment when CLI flags are omitted.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit a041116 into master May 21, 2026
@PurHur PurHur deleted the fix/aot-coalesce-and-web-phpt branch May 21, 2026 20:11
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