php-src/ext/mbstring/tests/mb_ereg_search_named_subpatterns_2.phpt
Nikita Popov 7485978339
Migrate SKIPIF -> EXTENSIONS (#7138)
This is an automated migration of most SKIPIF extension_loaded checks.
2021-06-11 11:57:42 +02:00

34 lines
723 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--TEST--
Testing mb_ereg_search() named capture groups
--EXTENSIONS--
mbstring
--SKIPIF--
<?php
function_exists('mb_ereg_search') or die("skip mb_ereg_search() is not available in this build");
version_compare(MB_ONIGURUMA_VERSION, '6.9.4', '>=') or die("skip requires oniguruma >= 6.9.4");
?>
--FILE--
<?php
mb_regex_encoding("UTF-8");
mb_ereg_search_init(' 中国?');
mb_ereg_search('(?<wsp>\s*)(?<word>\w+)(?<punct>[])');
var_dump(mb_ereg_search_getregs());
?>
--EXPECT--
array(7) {
[0]=>
string(11) " 中国?"
[1]=>
string(2) " "
[2]=>
string(6) "中国"
[3]=>
string(3) ""
["wsp"]=>
string(2) " "
["word"]=>
string(6) "中国"
["punct"]=>
string(3) ""
}