Skip to content

Commit 6b2c002

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Add additional preg_match test case
2 parents 11c698f + a1a044d commit 6b2c002

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

ext/pcre/tests/preg_match_latin.phpt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
--TEST--
2+
preg_match() single line match with latin input
3+
--FILE--
4+
<?php
5+
/* Prototype : int preg_match ( string $pattern , string $subject [, array &$matches [, int $flags [, int $offset ]]] )
6+
* Description: Perform a regular expression match
7+
* Source code: ext/pcre/php_pcre.c
8+
*/
9+
10+
preg_match('/^[\w\p{Cyrillic}\s\-\']+$/u', 'latin', $test1);
11+
preg_match('/^[\w\p{Cyrillic}\s\-\']+$/u', 'кириллица', $test2);
12+
preg_match('/^[\w\s\-\']+$/u', 'latin', $test3);
13+
14+
var_dump([$test1, $test2, $test3]);
15+
?>
16+
===Done===
17+
--EXPECT--
18+
array(3) {
19+
[0]=>
20+
array(1) {
21+
[0]=>
22+
string(5) "latin"
23+
}
24+
[1]=>
25+
array(1) {
26+
[0]=>
27+
string(18) "кириллица"
28+
}
29+
[2]=>
30+
array(1) {
31+
[0]=>
32+
string(5) "latin"
33+
}
34+
}
35+
===Done===

0 commit comments

Comments
 (0)