Skip to content

Conversation

nielsdos
Copy link
Member

Like in other languages, and especially C where printf originates from, a missing precision should be treated as a 0 precision. Because the ADJ_PRECISION flag was not set, the double formatting code resetted the precision to the default float precision of 6.

Targeting master because of the behavioural BC break.

Copy link
Member

@bukka bukka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, please add also note to UPGRADING

nielsdos added 2 commits June 24, 2025 19:05
…6, not as precision 0

Like in other languages, and especially C where printf originates from,
a missing precision should be treated as a 0 precision.
Because the ADJ_PRECISION flag was not set, the double formatting code
resetted the precision to the default float precision of 6.
@nielsdos nielsdos merged commit 5ed8b2b into php:master Jun 24, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

printf: empty precision is interpreted as precision 6, not as precision 0
3 participants