Skip to content

Stdlib: sprintf/vsprintf %'<char> custom pad (#22833)#22865

Merged
PurHur merged 1 commit into
masterfrom
agent/stdlib-22833-sprintf-custom-pad
Jul 24, 2026
Merged

Stdlib: sprintf/vsprintf %'<char> custom pad (#22833)#22865
PurHur merged 1 commit into
masterfrom
agent/stdlib-22833-sprintf-custom-pad

Conversation

@PurHur

@PurHur PurHur commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Parse php-src formatted_print.c %'<char> custom pad in VmSprintf so sprintf/vsprintf/printf match Zend instead of LogicException on %'
  • Covers pad char, left-adjust + custom pad, positional %1$'*10s, and ValueError: Missing padding character
  • php-src ref: ext/standard/formatted_print.c (modifier loop for ')

Closes #22833

Test plan

  • php test/repro/issue22833_sprintf_custom_pad.php vs php bin/vm.php — identical
  • php bin/jit.php test/repro/issue22833_sprintf_custom_pad.php — matches Zend
  • vendor/bin/phpunit --filter 'testVmSprintfCustomPad|sprintf_custom_pad' — OK
  • Standalone AOT NestedJIT SprintfJitHelper still only covers %03d/%d/%.*s shapes (pre-existing); custom pad remains VM/Internal path for MCJIT. Follow-up if NestedJIT pad loops are fixed.

Verification transcript

$ php bin/vm.php test/repro/issue22833_sprintf_custom_pad.php
*******************x
---------x
*********7
*******x
*********x
######ab
********+7
********+7
*******7
x*********
ValueError:Missing padding character

$ ./script/docker-exec.sh -- bash -lc 'php bin/jit.php test/repro/issue22833_sprintf_custom_pad_aot.php'
*******************x
*********7
*******x
*********x
x*********

Gate probe: bootstrap-inventory --check → OK 6512/6512. north-star5-fast still red at 4f-m gen-0 (#22642) — unrelated.

Made with Cursor

Parse php-src formatted_print.c %'<char> padding in VmSprintf so custom
pad formats match Zend on VM/JIT instead of LogicException on %'.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 95c310c into master Jul 24, 2026
PurHur added a commit that referenced this pull request Jul 24, 2026
…22866)

Post-#22847 merges (#22857/#22862/#22863/#22864/#22865) moved live
lowering_source_fingerprint to 9aee9361… while the committed stamp stayed
at 159f4081…, redding north-star5-verify-fast step 4f-m and
user_release_ready. Restamp only; honest verified-fresh remains on


#22642/#22717.

Co-authored-by: PurHur <PurHur@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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()/vsprintf() custom pad %'* throws LogicException — Zend pads (ext/standard/formatted_print.c)

1 participant