|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76999 mb-regex-set-options return current options
Submitted: 2018-10-11 13:17 UTC Modified: 2018-10-11 13:52 UTC
Avg. Score:3.5 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: kay dot lukas at gmail dot com Assigned:
Status: Verified Package: mbstring related
PHP Version: 7.1.22 OS: Mac OSX
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
12 + 34 = ?
Subscribe to this entry?

 [2018-10-11 13:17 UTC] kay dot lukas at gmail dot com
From manual page:

The documentation says that mb_regex_set_options should return the previous results, 

> The previous options. If options is omitted, it returns the string that describes the current options.

This is quite useful so you can change the options and easily set it back to the defaults after you are done with mb_regex. However, it seems to do something totally different, returning the current options instead.

It seems like the internal function is designed for it:

however this functionality is not used in the wrapping function:

null is passed in.

Test script:
php > var_dump(mb_regex_set_options("m"));
string(2) "mr"
php > var_dump(mb_regex_set_options("mdi"));
string(3) "imd"
php > var_dump(mb_regex_set_options("m"));
string(2) "mr"
php > var_dump(mb_regex_set_options("a"));
string(1) "r"


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-10-11 13:52 UTC]
-Status: Open +Status: Verified -Package: *Regular Expressions +Package: mbstring related
 [2018-10-11 13:52 UTC]
Confirmed: <>.
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Sep 18 20:01:27 2019 UTC