mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
7485978339
This is an automated migration of most SKIPIF extension_loaded checks.
39 lines
644 B
PHP
39 lines
644 B
PHP
--TEST--
|
||
Testing mb_ereg() duplicate named groups
|
||
--EXTENSIONS--
|
||
mbstring
|
||
--SKIPIF--
|
||
<?php
|
||
function_exists('mb_ereg') or die("skip mb_ereg() is not available in this build");
|
||
?>
|
||
--FILE--
|
||
<?php
|
||
mb_regex_encoding("UTF-8");
|
||
$pattern = '\w+((?<punct>?)|(?<punct>!))';
|
||
mb_ereg($pattern, '中?', $m);
|
||
var_dump($m);
|
||
mb_ereg($pattern, '中!', $m);
|
||
var_dump($m);
|
||
?>
|
||
--EXPECT--
|
||
array(4) {
|
||
[0]=>
|
||
string(6) "中?"
|
||
[1]=>
|
||
string(3) "?"
|
||
[2]=>
|
||
bool(false)
|
||
["punct"]=>
|
||
string(3) "?"
|
||
}
|
||
array(4) {
|
||
[0]=>
|
||
string(6) "中!"
|
||
[1]=>
|
||
bool(false)
|
||
[2]=>
|
||
string(3) "!"
|
||
["punct"]=>
|
||
string(3) "!"
|
||
}
|