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-23 17:35:09 +0200
commit51fb8398e2dcd56e7cb07bce9e0596ea14e2f03a (patch)
tree35da2a4f0f98d789f8251c65261aa905a5b1b2bf
parentccca2c448df35ac457eeef11fb7f0d604de3e5f9 (diff)
downloadphp-git-51fb8398e2dcd56e7cb07bce9e0596ea14e2f03a.tar.gz
Add additional preg_match test case
(cherry picked from commit a1a044dcc74379fafb2b63db5ab033aa062aada7 on author's explicit request)
-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===