rfc:grapheme_str_split
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:grapheme_str_split [2024/03/07 04:19] – Add comment youkidearitai | rfc:grapheme_str_split [2024/04/10 19:21] (current) – Implemented grapheme_str_split function youkidearitai | ||
---|---|---|---|
Line 3: | Line 3: | ||
* Date: 2024-03-04 | * Date: 2024-03-04 | ||
* Author: Yuya Hamada, youkidearitai@gmail.com | * Author: Yuya Hamada, youkidearitai@gmail.com | ||
- | * Status: | + | * Status: |
* First Published at: http:// | * First Published at: http:// | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | I noticed PHP does not have a grapheme cluster based str_split function. So I think need str_split for grapheme cluster, grapheme_str_split function using ICU. Creating this function in the Intl extension would provide stronger support for grapheme clusters. This feature will allow to correctly handle emoji and Variation Selectors. | + | I noticed PHP does not have a grapheme cluster based str_split function. So I think need str_split for grapheme cluster, grapheme_str_split function using [[https:// |
grapheme_str_split function is correctly support for grapheme cluster. | grapheme_str_split function is correctly support for grapheme cluster. | ||
Line 47: | Line 47: | ||
int(0) | int(0) | ||
} | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Examples of other languages. Ruby is already support grapheme clusters as [[https:// | ||
+ | |||
+ | < | ||
+ | s = " | ||
+ | s.grapheme_clusters | ||
+ | # => [" | ||
+ | </ | ||
+ | |||
+ | grapheme_str_split support to grapheme clusters (variation selectors). | ||
+ | |||
+ | < | ||
+ | $ sapi/ | ||
+ | array(13) { | ||
+ | [0]=> | ||
+ | string(2) " | ||
+ | [1]=> | ||
+ | string(1) " | ||
+ | [2]=> | ||
+ | string(1) " | ||
+ | [3]=> | ||
+ | string(1) " | ||
+ | [4]=> | ||
+ | string(1) " | ||
+ | [5]=> | ||
+ | string(1) " | ||
+ | [6]=> | ||
+ | string(3) " | ||
+ | [7]=> | ||
+ | string(1) " | ||
+ | [8]=> | ||
+ | string(1) " | ||
+ | [9]=> | ||
+ | string(1) " | ||
+ | [10]=> | ||
+ | string(1) " | ||
+ | [11]=> | ||
+ | string(1) " | ||
+ | [12]=> | ||
+ | string(3) " | ||
} | } | ||
</ | </ | ||
Line 64: | Line 106: | ||
===== Proposed PHP Version(s) ===== | ===== Proposed PHP Version(s) ===== | ||
- | next PHP 8.x | + | PHP 8.4 |
===== RFC Impact ===== | ===== RFC Impact ===== | ||
Line 93: | Line 135: | ||
===== Proposed Voting Choices ===== | ===== Proposed Voting Choices ===== | ||
- | Include these so readers know where you are heading and can discuss the proposed voting options. | + | <doodle title=" |
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
rfc/grapheme_str_split.1709785149.txt.gz · Last modified: 2024/03/07 04:19 by youkidearitai