Perf: printf/sprintf %b of floats and overflow longs match Zend (#36386) - #37078
Merged
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Sep 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
printf/sprintf%bof overflow-promoted ints and large floats printed0while%d/%o/%x/echomatched Zend — leftover of Perf: lazy f64 overflow slot for native-long ±/× (#36386) #37051 lazy ±/× materialize and Perf: printf/sprintf %d of floats and overflow longs match Zend (#36386) #37075 (which fixed%d/%u/%xbut left%bon the non-integer snprintf arm).%bas an integer conversion (extractSnprintfLongArg+%llbpromote), teachSprintfSnprintfRuntimethe same, and materialize overflowable native-long argv for non-const formats via__compiler_sprintf.php-src:
ext/standard/formatted_print.c%b(unsigned machine-word bit pattern) /zval_get_long;Zend/zend_operators.hzend_dval_to_lval.Test plan
./script/phpunit.sh --filter 'SprintfPercentBAotTest|SprintfPercentDFloatAotTest|SprintfOverflowableNativeLongAotTest|EchoOverflowableNativeLongAotTest'→ 18/18 OK (90 assertions)./script/aot-smoke.sh→ 9/9 + size gate OKmake north-star5-verify-fast→ OK (spine 8353/8353)script/differential-sweep.sh --aot --repeat 3(sprintf%bcoercion only; peer of Perf: printf/sprintf %d of floats and overflow longs match Zend (#36386) #37075)Closes nothing (Part of #36386).
Made with Cursor