Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

The mbstring Regex (mbregex) Functions Are Deprecated

The mb_ereg*() family of functions (mb_ereg(), mb_eregi(), mb_ereg_match(), mb_ereg_replace(), mb_ereg_search() and its siblings, mb_split(), and related functions) wraps the bundled Oniguruma regex library, which is no longer maintained upstream. Until PHP 8.6, calling any of these functions worked silently. In PHP 8.6, calling any mbregex function emits a deprecation notice, even though the function still behaves exactly as before.

PHP code

<?php

var_dump(mb_ereg("^a", "abc"));

?>

Before

bool(true)

After

PHP Deprecated:  Function mb_ereg() is deprecated since 8.6, because the underlying library is no longer maintained in /codes/mbregexDeprecated.php on line 3

Deprecated: Function mb_ereg() is deprecated since 8.6, because the underlying library is no longer maintained in /codes/mbregexDeprecated.php on line 3
bool(true)

PHP version change

This behavior was deprecated in 8.6.

This behavior changed in .

See Also

Error Messages

Extension

© 2023-2026, Damien Seguy - Exakat