summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2010-11-15 18:46:59 +0000
committerFelipe Pena <felipe@php.net>2010-11-15 18:46:59 +0000
commit43206c8c68ea2c9365994c4f608c7d02354e7f6b (patch)
treee54ebf8bc549f354e2f3406a3d7adf7a2cd03c88
parente10454ded867c286a21c949df9eab55f510b368d (diff)
downloadphp-git-43206c8c68ea2c9365994c4f608c7d02354e7f6b.tar.gz
- Added missing test
-rw-r--r--ext/pcre/tests/bug52971.phpt43
1 files changed, 43 insertions, 0 deletions
diff --git a/ext/pcre/tests/bug52971.phpt b/ext/pcre/tests/bug52971.phpt
new file mode 100644
index 0000000000..5949cb220c
--- /dev/null
+++ b/ext/pcre/tests/bug52971.phpt
@@ -0,0 +1,43 @@
+--TEST--
+Bug #52971 (PCRE-Meta-Characters not working with utf-8)
+--SKIPIF--
+<?php if ((double)PCRE_VERSION < 8.1) die('skip PCRE_VERSION >= 8.1 is required!'); ?>
+--FILE--
+<?php
+
+$message = 'Der ist ein Süßwasserpool Süsswasserpool ... verschiedene Wassersportmöglichkeiten bei ...';
+
+$pattern = '/\bwasser/iu';
+preg_match_all($pattern, $message, $match, PREG_OFFSET_CAPTURE);
+var_dump($match);
+
+$pattern = '/[^\w]wasser/iu';
+preg_match_all($pattern, $message, $match, PREG_OFFSET_CAPTURE);
+var_dump($match);
+
+?>
+--EXPECTF--
+array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(2) {
+ [0]=>
+ string(6) "Wasser"
+ [1]=>
+ int(61)
+ }
+ }
+}
+array(1) {
+ [0]=>
+ array(1) {
+ [0]=>
+ array(2) {
+ [0]=>
+ string(7) " Wasser"
+ [1]=>
+ int(60)
+ }
+ }
+}