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