Skip to content

mb_regex_set_options never had eval option? #2103

Open
@afilina

Description

@afilina
  • PHP 7.1: Eval option deprecated in mb_ereg_replace and mb_eregi_replace (RFC).
  • PHP 8.0: Eval option removed, but also throws a ValueError with mb_regex_set_options (not documented, AFAIK).

However, when trying to set e using mb_regex_set_options in versions where it was still allegedly supported, it seems to have no effect.

// In PHP 5.0 through 7.4, this returns ixplnr, without e
var_dump(mb_regex_set_options('ixplner')); 
// this does not have the eval effect
var_dump(mb_ereg_replace('(h)', 'strtoupper("\\1")', 'hello', null)); 

Result in all versions: https://3v4l.org/pXd41G

Was eval ever a thing with mb_regex_set_options? Should I update the docs to reflect reality, or am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions