MBString
- On invalid strings (those with encoding errors),
- mb_substr now interprets character indices in the same
- manner as most other mbstring functions.
+ As of PHP 8.3.2, on invalid strings (those with encoding errors),
+ mb_substr and mb_strstr interpret
+ character indices in the same manner as most other mbstring functions.
This means that character indices returned by mb_strpos
can be passed to mb_substr.
- For SJIS-Mac (MacJapanese) strings, character indices passed to
- mb_substr now refer to the indices of the Unicode
- codepoints which are produced when the string is converted to Unicode.
- This is significant because around 40 SJIS-Mac characters convert to a
- sequence of multiple Unicode codepoints.
+ For SJIS-mac (MacJapanese) strings, those character
+ indices refer to the indices of the Unicode codepoints which are produced
+ when the string is converted to Unicode, which differ from the character
+ indices for the SJIS-mac characters that convert to a
+ sequence of several codepoints.
diff --git a/reference/mbstring/book.xml b/reference/mbstring/book.xml
index 3de34d4edc8a..046c4e5031f8 100644
--- a/reference/mbstring/book.xml
+++ b/reference/mbstring/book.xml
@@ -28,14 +28,19 @@
the multibyte character and ends up with a corrupted garbage string that
most likely loses its original meaning.
-
- mbstring provides multibyte specific string functions
- that help you deal with multibyte encodings in PHP. In addition to that,
- mbstring handles character encoding conversion between
- the possible encoding pairs. mbstring is designed to
- handle Unicode-based encodings such as UTF-8 and UCS-2 and many
+
+ mbstring provides multibyte specific string functions
+ that help you deal with multibyte encodings in PHP. In addition to that,
+ mbstring handles character encoding conversion between
+ the possible encoding pairs. mbstring is designed to
+ handle Unicode-based encodings such as UTF-8 and UCS-2 and many
single-byte encodings for convenience (listed in Supported Character Encodings).
-
+
+
+ The Unicode data tables used by mbstring have been
+ updated to Unicode 16.0 as of PHP 8.4.0, and to Unicode 17.0 as of
+ PHP 8.5.0.
+
diff --git a/reference/mbstring/functions/mb-strstr.xml b/reference/mbstring/functions/mb-strstr.xml
index 96ec7d64252c..eb61d8e83ec2 100644
--- a/reference/mbstring/functions/mb-strstr.xml
+++ b/reference/mbstring/functions/mb-strstr.xml
@@ -84,6 +84,16 @@
+
+ 8.3.2
+
+ On invalid strings (those with encoding errors) and on
+ SJIS-mac (MacJapanese) strings, the portion of
+ haystack returned when
+ before_needle is &true; is now determined from
+ the same character indices as the other mbstring functions.
+
+
&mbstring.changelog.needle-empty;
&mbstring.changelog.encoding-nullable;
diff --git a/reference/mbstring/functions/mb-substr.xml b/reference/mbstring/functions/mb-substr.xml
index 7f769da05fdb..4fc252f73e6c 100644
--- a/reference/mbstring/functions/mb-substr.xml
+++ b/reference/mbstring/functions/mb-substr.xml
@@ -98,12 +98,17 @@
- 8.4.0
+ 8.3.2
On invalid strings (those with encoding errors),
character indices are now interpreted in the same manner as most
other mbstring functions. This means that character indices returned
by mb_strpos can be passed directly.
+ For SJIS-mac (MacJapanese) strings, character
+ indices now refer to the indices of the Unicode codepoints produced
+ when the string is converted to Unicode, which differ from the
+ character indices for the SJIS-mac characters that
+ convert to a sequence of several codepoints.
&mbstring.changelog.encoding-nullable;
@@ -114,12 +119,10 @@
&reftitle.seealso;
-
-
- mb_strcut
- mb_internal_encoding
-
-
+
+ mb_strcut
+ mb_internal_encoding
+