summaryrefslogtreecommitdiff
path: root/ext/pcre/tests
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-09-17 13:44:42 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2020-09-17 14:07:05 +0200
commit9f2d03952daf5348d7f18c18e82607979e28df12 (patch)
tree3ef15cced72c2e272b7e35f63c9666cc803e4967 /ext/pcre/tests
parentc3c76dbfb9cd43989423dd94bb9a6342d7adcc2b (diff)
downloadphp-git-9f2d03952daf5348d7f18c18e82607979e28df12.tar.gz
Update to PCRE2 10.35
We also backport the fix for bug #79846, and add a test case for the related bug #79363.
Diffstat (limited to 'ext/pcre/tests')
-rw-r--r--ext/pcre/tests/bug79363.phpt11
-rw-r--r--ext/pcre/tests/bug79846.phpt17
2 files changed, 28 insertions, 0 deletions
diff --git a/ext/pcre/tests/bug79363.phpt b/ext/pcre/tests/bug79363.phpt
new file mode 100644
index 0000000000..fffeb50e3c
--- /dev/null
+++ b/ext/pcre/tests/bug79363.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Bug #79363 (\p{L} doesn't work alongside \p{Arabic} in a character class)
+--FILE--
+<?php
+$str = 'lower UPPER';
+var_dump(preg_replace('/[\p{L}\p{Arabic}]/', '0', $str));
+var_dump(preg_replace('/[^\p{L}\p{Arabic}]/', '0', $str));
+?>
+--EXPECT--
+string(11) "00000 00000"
+string(11) "lower0UPPER"
diff --git a/ext/pcre/tests/bug79846.phpt b/ext/pcre/tests/bug79846.phpt
new file mode 100644
index 0000000000..b995c38794
--- /dev/null
+++ b/ext/pcre/tests/bug79846.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #79846 (8c67c166996 broke simple regexp)
+--FILE--
+<?php
+$item = "component_phase_1";
+preg_match("/([a-z]+_[a-z]+_*[a-z]+)_?(\d+)?/", $item, $match);
+var_dump($match);
+?>
+--EXPECT--
+array(3) {
+ [0]=>
+ string(17) "component_phase_1"
+ [1]=>
+ string(15) "component_phase"
+ [2]=>
+ string(1) "1"
+}