Skip to content

AOT: number_format() via LLVM runtime for static web apps#226

Merged
PurHur merged 1 commit into
masterfrom
feat/aot-number-format-llvm
May 18, 2026
Merged

AOT: number_format() via LLVM runtime for static web apps#226
PurHur merged 1 commit into
masterfrom
feat/aot-number-format-llvm

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented May 18, 2026

Summary

  • Implement number_format() for LLVM AOT/JIT by calling a C runtime helper (__compiler_number_format) linked into AOT binaries alongside superglobal refresh.
  • Add AOT test coverage: PHPT fixture, WebAppNumberFormatTest (price template), and fix AOT getenv tests to pass ENV sections to compiled binaries via env.
  • Update capability matrix: number_format is now JIT/AOT capable.

Test plan

  • docker run … php vendor/bin/phpunit --group llvm --filter AotTest|WebAppNumberFormatTest|ExampleWebAotTest|StdlibWebBuiltinsTest (36 tests)
  • Manual: echo '<?php echo number_format(1234.5, 2), "\n";' | php bin/compile.php -o /tmp/nf && /tmp/nf1,234.50

Made with Cursor

Implement __compiler_number_format in the AOT runtime (linked with superglobals)
and wire number_format() through JitNumberFormat for native binaries. Add AOT
PHPT and WebAppNumberFormatTest; fix AOT getenv ENV propagation when running
compiled binaries.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit b00a470 into master May 18, 2026
@PurHur PurHur deleted the feat/aot-number-format-llvm branch May 18, 2026 18:30
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