[RFC] Add grapheme_strrev function php 8.6#578
Merged
nicolas-grekas merged 1 commit intosymfony:1.xfrom Apr 26, 2026
Merged
Conversation
70c1e8e to
bec69dd
Compare
Ayesh
approved these changes
Apr 20, 2026
Contributor
Ayesh
left a comment
There was a problem hiding this comment.
Hi @PhilDaiguille - thank you for the PR. I'm a regular contributor just like you, but I wrote the article mentioned in the PR. Thank you for the mention.
I marked one place that I'm not quite sure why there is a preg_match check against an empty regex, but other than that, the polyfill and the tests look good to me!
When the grapheme_str_split function was added, it was added to both Intl and PHP 8.4 polyfills, so maybe it makes sense to polyfill grapheme_strrev for both Intl and PHP 8.6 too? The PHP 8.6 polyfill can use an extension_loaded('intl') so it only polyfills if the older PHP version has the "real" Intl extension.
Ayesh
approved these changes
Apr 24, 2026
xabbuh
reviewed
Apr 24, 2026
6634691 to
ab78662
Compare
Member
|
Thank you @PhilDaiguille. |
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.
Adds the new grapheme_strrev function added to PHP 8.6. This function is part of the Intl extension's Grapheme functions and reverses a string by grapheme clusters, correctly handling multi-byte and multi code-point characters (such as Emoji sequences).