Skip to content

Perf: printf/sprintf %d of floats and overflow longs match Zend (#36386) - #37075

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-36386-sprintf-percent-d-overflow
Sep 6, 2026
Merged

Perf: printf/sprintf %d of floats and overflow longs match Zend (#36386)#37075
PurHur merged 1 commit into
masterfrom
agent/issue-36386-sprintf-percent-d-overflow

Conversation

@PurHur

@PurHur PurHur commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Summary

php-src: ext/standard/formatted_print.c php_formatted_print / zval_get_long; Zend/zend_operators.h zend_dval_to_lval.

Test plan

  • ./script/phpunit.sh --filter 'SprintfPercentDFloatAotTest|SprintfOverflowableNativeLongAotTest|EchoOverflowableNativeLongAotTest'13/13 OK
  • ./script/aot-smoke.sh9/9 + size gate OK
  • make north-star5-verify-fast → OK (spine 8351/8351)
  • Not run: script/differential-sweep.sh --aot --repeat 3 (sprintf coercion only; peer of Perf: printf/sprintf %s of overflowable native-long matches Zend (#36386) #37068)

Closes nothing (Part of #36386).

Made with Cursor

Integer conversions were passing i64 to libc %d (LP64 reads 32-bit → PHP_INT_MIN printed 0) and IEEE doubles without zend_dval_to_lval. Promote %d→%lld, coerce floats via saturating dval_to_lval, and teach packed argv TAG_DOUBLE → (int).

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.

1 participant