]> granicus.if.org Git - php/commitdiff
new test to keep track of the reported pcre regression
authorNuno Lopes <nlopess@php.net>
Fri, 9 Feb 2007 20:00:17 +0000 (20:00 +0000)
committerNuno Lopes <nlopess@php.net>
Fri, 9 Feb 2007 20:00:17 +0000 (20:00 +0000)
ext/pcre/tests/bug40195.phpt [new file with mode: 0644]

diff --git a/ext/pcre/tests/bug40195.phpt b/ext/pcre/tests/bug40195.phpt
new file mode 100644 (file)
index 0000000..0de625c
--- /dev/null
@@ -0,0 +1,45 @@
+--TEST--
+Bug #40195: pcre 6.7 regression
+--FILE--
+<?php
+
+var_dump(preg_match('@^(/([a-z]*))*$@', '//abcde', $m)); var_dump($m);
+var_dump(preg_match('@^(/(?:[a-z]*))*$@', '//abcde', $m)); var_dump($m);
+
+var_dump(preg_match('@^(/([a-z]+))+$@', '/a/abcde', $m)); var_dump($m);
+var_dump(preg_match('@^(/(?:[a-z]+))+$@', '/a/abcde', $m)); var_dump($m);
+
+?>
+--EXPECT--
+int(1)
+array(3) {
+  [0]=>
+  string(7) "//abcde"
+  [1]=>
+  string(6) "/abcde"
+  [2]=>
+  string(5) "abcde"
+}
+int(1)
+array(2) {
+  [0]=>
+  string(7) "//abcde"
+  [1]=>
+  string(6) "/abcde"
+}
+int(1)
+array(3) {
+  [0]=>
+  string(8) "/a/abcde"
+  [1]=>
+  string(6) "/abcde"
+  [2]=>
+  string(5) "abcde"
+}
+int(1)
+array(2) {
+  [0]=>
+  string(8) "/a/abcde"
+  [1]=>
+  string(6) "/abcde"
+}