Oniguruma maintenance ended on 2025-04-24. PHP uses mbregex (mb_ereg...) functions. So we decide future of mbregex. This proposal is to end support for mbregex in PHP 9.0 and deprecate in 8.6.
Deprecate mbregex functions in PHP 8.6, remove in 9.0.
Deprecated: Function mb_ereg_replace() is deprecated since 8.6, Oniguruma functions support ends PHP 9.0 in %s on line %d
It is likely that the following points need to be decided, and how we will maintain versions 8.2 - 8.5.
Maintenance versions can use mbregex functions. However, FreeBSD will drop support on 2026-12-01 (ref: https://github.com/php/php-src/issues/18467#issuecomment-3044192511). We should decide what we will do after EOL in FreeBSD. (This affects CI in the php-src repository)
I suggest:
In Ruby, There is a Onigmo forked from Oniguruma.
However, Onigmo is different than Oniguruma.
I quoted from https://news-web.php.net/php.internals/130429
Uses code from Juliette: https://gist.github.com/jrfnl/bd0f66f1c185930427db4f093babf214
Summary of findings: PHP CODE SNIFFER VIOLATION SOURCE SUMMARY ------------------------------------------------------------------------------------------- SOURCE COUNT ------------------------------------------------------------------------------------------- PHPCompatibility.FunctionUse.RemovedFunctions.mb_splitDeprecated 30 PHPCompatibility.FunctionUse.RemovedFunctions.mb_regex_encodingDeprecated 25 PHPCompatibility.FunctionUse.RemovedFunctions.mb_eregi_replaceDeprecated 20 PHPCompatibility.FunctionUse.RemovedFunctions.mb_ereg_replaceDeprecated 18 PHPCompatibility.FunctionUse.RemovedFunctions.mb_ereg_matchDeprecated 13 PHPCompatibility.FunctionUse.RemovedFunctions.mb_ereg_search_initDeprecated 10 PHPCompatibility.FunctionUse.RemovedFunctions.mb_ereg_search_regsDeprecated 9 PHPCompatibility.FunctionUse.RemovedFunctions.mb_ereg_replace_callbackDeprecated 6 PHPCompatibility.FunctionUse.RemovedFunctions.mb_ereg_search_getregsDeprecated 5 PHPCompatibility.FunctionUse.RemovedFunctions.mb_eregDeprecated 4 PHPCompatibility.FunctionUse.RemovedFunctions.mb_ereg_search_setposDeprecated 4 PHPCompatibility.FunctionUse.RemovedFunctions.mb_eregiDeprecated 2 PHPCompatibility.FunctionUse.RemovedFunctions.mb_ereg_search_posDeprecated 1 ------------------------------------------------------------------------------------------- A TOTAL OF 147 SNIFF VIOLATIONS WERE FOUND IN 13 SOURCES -------------------------------------------------------------------------------------------
Thanks, Juliette.
However, proprietary software probably uses mbregex functions, so impact is larger than that result.
This RFC has a big impact on multibyte (not UTF-8) users.
Therefore, I created bailout extension mb_onig https://packagist.org/packages/mb_onig/mb_onig so PHP 8.x can still use mbregex functions and we can still maintain mbregex for PHP 9.x.
Debian/Ubuntu users call Oniguruma `onig`. I quoted this.
$ sudo apt search onig libonig-dev/noble,now 6.9.9-1build1 amd64 [installed] regular expressions library — development files libonig5/noble,now 6.9.9-1build1 amd64 [installed,automatic] regular expressions library
./configure --enable-mbstring --disable-mbregex make make install pie install mb_onig/mb_onig
./configure --enable-mbstring make make install pie install mb_onig/mb_onig
The mbregex functions cannot be used.
Deprecate for 8.6 and remove in 9.0.
Mbregex
Describe the impact to CLI, Development web server, embedded PHP etc.
This section should outline areas that you are not planning to work on in the scope of this RFC, but that might be iterated upon in the future by yourself or another contributor.
This helps with long-term planning and ensuring this RFC does not prevent future work.
Primary Vote requiring a 2/3 majority to accept the RFC:
Keep this updated with features that were discussed on the mail lists.
If there are major changes to the initial proposal, please include a short summary with a date or a link to the mailing list announcement here, as not everyone has access to the wikis' version history.