xref: /php-src/ext/mbstring/tests/bug76999.phpt (revision 74859783)
1--TEST--
2Bug #76999 (mb_regex_set_options() return current options)
3--EXTENSIONS--
4mbstring
5--SKIPIF--
6<?php
7if (!function_exists('mb_regex_set_options')) die('skip mb_regex_set_options() not available');
8?>
9--FILE--
10<?php
11mb_regex_set_options("pr");
12var_dump(mb_regex_set_options("m"));
13var_dump(mb_regex_set_options("mdi"));
14var_dump(mb_regex_set_options("m"));
15try {
16    var_dump(mb_regex_set_options("a"));
17} catch (\ValueError $e) {
18    echo $e->getMessage() . \PHP_EOL;
19}
20var_dump(mb_regex_set_options());
21?>
22--EXPECT--
23string(2) "pr"
24string(2) "mr"
25string(3) "imd"
26Option "a" is not supported
27string(2) "mr"
28