-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Prefix all sprintf() calls #57461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Prefix all sprintf() calls #57461
Conversation
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
0b8cf23
to
7bf787a
Compare
cc @beberlei |
f4f2588
to
f94ea7f
Compare
stof
reviewed
Jun 20, 2024
f94ea7f
to
b6661b7
Compare
OskarStark
approved these changes
Jun 20, 2024
Should |
b6661b7
to
6ce530c
Compare
Will do, as soon as this PR is merged and the commit hash is final. |
fabpot
approved these changes
Jun 21, 2024
Thank you @derrabus. |
|
derrabus
added a commit
that referenced
this pull request
Jun 21, 2024
This PR was merged into the 7.2 branch. Discussion ---------- Add CS commit to .git-blame-ignore-revs | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | Follows #57461 | License | MIT Let's ignore 6ce530c from #57461 when blaming changes. Commits ------- 2686d9d Add CS commit to .git-blame-ignore-revs
smnandre
added a commit
to smnandre/ux
that referenced
this pull request
Jun 22, 2024
smnandre
added a commit
to smnandre/ux
that referenced
this pull request
Jun 22, 2024
kbond
added a commit
to symfony/ux
that referenced
this pull request
Jun 26, 2024
This PR was squashed before being merged into the 2.x branch. Discussion ---------- [CS] Optimize `sprintf` calls for PHP 8.4 Follows * symfony/symfony#57461 * twigphp/Twig#4108 Update php-cs-fixer config + apply rule on all the repository code Commits ------- eab7db5 [CS] Optimize `sprintf` calls for PHP 8.4
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.
see https://tideways.com/profiler/blog/new-in-php-8-4-engine-optimization-of-sprintf-to-string-interpolation
In PHP 8.4, some calls to
sprintf()
will be optimized by the compiler. I therefore propose to change our code style and force calls to that function to be prefixed with a\
. This will tell the compiler that this function must not be looked up in the current namespace first and allow the compiler to optimize the call.The changes have been automated with PHP CS Fixer.