Skip to content

Stdlib: sprintf() for VM, JIT, and AOT#392

Merged
PurHur merged 1 commit into
masterfrom
agent/stdlib-sprintf
May 20, 2026
Merged

Stdlib: sprintf() for VM, JIT, and AOT#392
PurHur merged 1 commit into
masterfrom
agent/stdlib-sprintf

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented May 20, 2026

Summary

  • Adds sprintf() with documented subset: %s, %d, %f, and %% (no PHP internal_* wrappers).
  • VM uses VmSprintf; JIT/AOT call native __compiler_sprintf in the AOT runtime with boxed scalar args.
  • Compliance PHPT (sprintf.phpt, sprintf_jit.phpt) and AOT fixture sprintf.phpt; capability matrix updated.

Closes #89

Test plan

  • vendor/bin/phpunit --filter sprintf test/compliance/ (VM + compliance) — OK in Docker
  • ./script/docker-ci-local.sh --filter sprintf — docs/bootstrap checks + suite green
  • Full ./script/docker-ci-local.sh on maintainer host (JIT probe may skip @group llvm if MCJIT malloc probe fails in container)

Made with Cursor

Implement %s, %d, %f, and %% formatting without PHP internal wrappers:
VmSprintf for the interpreter, __compiler_sprintf in the AOT runtime, and
JitSprintf boxing for LLVM. Includes compliance and AOT PHPT coverage.

Closes #89

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur force-pushed the agent/stdlib-sprintf branch from b0a9c84 to a7abc2f Compare May 20, 2026 17:25
@PurHur PurHur merged commit 2081ebf into master May 20, 2026
1 check passed
@PurHur PurHur deleted the agent/stdlib-sprintf branch May 20, 2026 17:26
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: sprintf and printf for HTML/template formatting

1 participant