Skip to content

ext/mbstring: fix the version of the character index change, it shipped in 8.3.2 - #5797

Open
lacatoire wants to merge 1 commit into
php:masterfrom
lacatoire:group/mbstring-8.4
Open

ext/mbstring: fix the version of the character index change, it shipped in 8.3.2#5797
lacatoire wants to merge 1 commit into
php:masterfrom
lacatoire:group/mbstring-8.4

Conversation

@lacatoire

@lacatoire lacatoire commented Aug 26, 2026

Copy link
Copy Markdown
Member

The mb_substr changelog dated the character index change to 8.4.0, which is what UPGRADING says, but the commit landed on the PHP-8.3 branch and the first release containing it is 8.3.2. git tag --contains ec348a12d11 gives php-8.3.2 before any 8.4 tag, and the official images bisect cleanly:

PHP mb_substr("A\x85\xABB", 1, 1, "SJIS-mac") mb_substr("\xf0start", 1, 5)
8.3.1 85ab (whole SJIS unit) rt
8.3.2 3f (single codepoint) start
8.4 3f start

A user on 8.3 reading the current table concludes they are unaffected, which is the failure mode the changelog exists to prevent.

  • mb-substr.xml: merge the two rows into a single 8.3.2 entry, both described the same commit
  • mb-strstr.xml: add the same entry, mb_strstr is affected too (mb_strstr("A\x85\xABB", "B", true, "SJIS-mac") returns 4185ab42 on 8.3.1, 4185ab from 8.3.2) and had no changelog for it
  • migration84/incompatible.xml: state the actual version; the change is still relevant to anyone upgrading from 8.3.0 or 8.3.1
  • use the encoding name the manual and php-src actually use, SJIS-mac (supported-encodings.xml, mbfilter_cjk.c), and drop the "around 40" figure: an exhaustive scan of the two-byte SJIS-mac units gives 56 that produce several codepoints
  • mb-substr.xml: take the seealso simplelist out of its para
  • book.xml: the Unicode table version is not a standing fact, 8.5.0 updated the tables to Unicode 17.0, so name both releases rather than leaving the intro false for 8.5 readers

Sources

Change Source
Character indices, invalid strings and SJIS-mac php-src ec348a12d11 - "Character indices used by mb_strpos and mb_substr have same meaning, even on invalid strings" (2023-12-06), first tag php-8.3.2
Unicode 16.0 tables php-src 3afb96184e7 ("ext/mbstring: Update to Unicode 16"), first tag php-8.4.0RC1
Unicode 17.0 tables php-src edc26712278 ("ext/mbstring: Update to Unicode 17.0"), PHP-8.5

Note: the 8.4 UPGRADING entry is itself mis-attributed, the change shipped silently in 8.3.2 with no NEWS entry. A php-src correction would be the root fix.

@lacatoire lacatoire added the 8.4 label Aug 26, 2026
@lacatoire lacatoire added this to the PHP 8.4 milestone Aug 26, 2026
…ed in 8.3.2

The mb_substr changelog dated the character index change to 8.4.0, which
is what UPGRADING says, but the commit landed on the PHP-8.3 branch and
the first release containing it is 8.3.2. Verified by bisecting the
official images: mb_substr("A\x85\xABB", 1, 1, "SJIS-mac") returns the
whole SJIS unit on 8.3.1 and a single codepoint from 8.3.2 onwards, and
mb_substr("\xf0start", 1, 5) likewise flips at the same boundary.

- mb-substr.xml: merge the two rows into a single 8.3.2 entry, both
  described the same commit
- mb-strstr.xml: add the same entry, mb_strstr is affected too and had no
  changelog for it
- migration84/incompatible.xml: state the actual version, the change is
  still relevant to anyone upgrading from 8.3.0 or 8.3.1
- use the encoding name the manual and php-src actually use, SJIS-mac,
  and drop the "around 40" figure, an exhaustive scan of the two byte
  SJIS-mac units gives 56
- mb-substr.xml: take the seealso simplelist out of its para
- book.xml: the Unicode table version is not a standing fact, 8.5.0
  updated the tables to Unicode 17.0, so name both releases

Sources
- php-src ec348a12d11 ("Character indices used by mb_strpos and mb_substr
  have same meaning, even on invalid strings", 2023-12-06), first tag
  php-8.3.2
- php-src 3afb96184e7 ("ext/mbstring: Update to Unicode 16"), first tag
  php-8.4.0RC1
- php-src edc26712278 ("ext/mbstring: Update to Unicode 17.0"), PHP-8.5
@lacatoire lacatoire changed the title ext/mbstring: Note Unicode 16.0 data tables and SJIS-Mac mb_substr index change (8.4.0) ext/mbstring: fix the version of the character index change, it shipped in 8.3.2 Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant