[PHP-CVS] [php-src] PHP-8.5: Merge branch 'PHP-8.4' into PHP-8.5

[email protected] (Weilin Du)
Newsgroups php.cvs
Message-ID <[email protected]>
Author: Weilin Du (LamentXU123)
Date: 2026-08-18T22:58:20+08:00

Commit: https://github.com/php/php-src/commit/17ee5f6c576d9544c0138c24ba08f58515d9f541
Raw diff: https://github.com/php/php-src/commit/17ee5f6c576d9544c0138c24ba08f58515d9f541.diff

Merge branch 'PHP-8.4' into PHP-8.5

* PHP-8.4:
  Stop grapheme_str_split from using UBRK_DONE as a byte index (#23349)

Changed paths:
  M  NEWS
  M  ext/intl/grapheme/grapheme_string.c


Diff:

diff --git a/NEWS b/NEWS
index 63ec75891ce0..c7f1fd692594 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,7 @@ PHP                                                                        NEWS
     for UTF-8 strings). (ColumbusLabs)
   . Fixed Locale::parseLocale() reading past a trailing '-' or '_'.
     (iliaal, Xuyang Zhang)
+  . Fixed grapheme_str_split() treating UBRK_DONE as a byte index. (iliaal)
 
 - Opcache:
   . Fixed opcache.protect_memory race under ZTS. (realFlowControl)
diff --git a/ext/intl/grapheme/grapheme_string.c b/ext/intl/grapheme/grapheme_string.c
index 28d3130c3959..f0fa069c7d52 100644
--- a/ext/intl/grapheme/grapheme_string.c
+++ b/ext/intl/grapheme/grapheme_string.c
@@ -904,9 +904,9 @@ PHP_FUNCTION(grapheme_str_split)
 				add_next_index_stringl(return_value, pstr, pos - current);
 				end = pstr + pos - current;
 				i = 0;
+				pstr += pos - current;
+				current = pos;
 			}
-			pstr += pos - current;
-			current = pos;
 		} else {
 			i += 1;
 		}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.