summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Campbell <graham@alt-three.com>2020-04-07 15:41:06 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2020-04-22 15:02:08 +0200
commita1a044dcc74379fafb2b63db5ab033aa062aada7 (patch)
tree63d12a2fbc04117efbe18f036567650537e0f522
parent225117af71bea68969dfe99736326092183cb9b7 (diff)
downloadphp-git-a1a044dcc74379fafb2b63db5ab033aa062aada7.tar.gz
Add additional preg_match test case
-rw-r--r--ext/pcre/tests/preg_match_latin.phpt35
1 files changed, 35 insertions, 0 deletions
diff --git a/ext/pcre/tests/preg_match_latin.phpt b/ext/pcre/tests/preg_match_latin.phpt
new file mode 100644
index 0000000000..8f1d1899cb
--- /dev/null
+++ b/ext/pcre/tests/preg_match_latin.phpt
@@ -0,0 +1,35 @@
+--TEST--
+preg_match() single line match with latin input
+--FILE--
+<?php
+/* Prototype : int preg_match ( string $pattern , string $subject [, array &$matches [, int $flags [, int $offset ]]] )
+ * Description: Perform a regular expression match
+ * Source code: ext/pcre/php_pcre.c
+ */
+
+preg_match('/^[\w\p{Cyrillic}\s\-\']+$/u', 'latin', $test1);
+preg_match('/^[\w\p{Cyrillic}\s\-\']+$/u', 'кириллица', $test2);
+preg_match('/^[\w\s\-\']+$/u', 'latin', $test3);
+
+var_dump([$test1, $test2, $test3]);
+?>
+===Done===
+--EXPECT--
+array(3) {
+ [0]=>
+ array(1) {
+ [0]=>
+ string(5) "latin"
+ }
+ [1]=>
+ array(1) {
+ [0]=>
+ string(18) "кириллица"
+ }
+ [2]=>
+ array(1) {
+ [0]=>
+ string(5) "latin"
+ }
+}
+===Done===