Skip to content

[13.x] Replace mb_split with preg_split#60012

Merged
taylorotwell merged 2 commits into
laravel:13.xfrom
jnoordsij:replace-mb-split
May 6, 2026
Merged

[13.x] Replace mb_split with preg_split#60012
taylorotwell merged 2 commits into
laravel:13.xfrom
jnoordsij:replace-mb-split

Conversation

@jnoordsij
Copy link
Copy Markdown
Contributor

The mb_split function, one of the mbregex functions of the PHP mbstring extension, is deprecated in PHP 8.6 and scheduled for removal in PHP 9.0. See also https://wiki.php.net/rfc/eol-oniguruma.

For UTF-8 multibyte strings, the preg_split should be able to achieve the results, hence this PR proposes to replace all usages accordingly. To validate behavior remains identical, some additional tests were introduced.

/cc @shaedrich as original author of #56338.

@taylorotwell taylorotwell merged commit 0de76c2 into laravel:13.x May 6, 2026
54 checks passed
@jnoordsij jnoordsij deleted the replace-mb-split branch May 6, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants