xref: /PHP-5.3/ext/pcre/tests/bug40195.phpt (revision 1f655451)
1--TEST--
2Bug #40195 (pcre 6.7 regression)
3--FILE--
4<?php
5
6var_dump(preg_match('@^(/([a-z]*))*$@', '//abcde', $m)); var_dump($m);
7var_dump(preg_match('@^(/(?:[a-z]*))*$@', '//abcde', $m)); var_dump($m);
8
9var_dump(preg_match('@^(/([a-z]+))+$@', '/a/abcde', $m)); var_dump($m);
10var_dump(preg_match('@^(/(?:[a-z]+))+$@', '/a/abcde', $m)); var_dump($m);
11
12?>
13--EXPECT--
14int(1)
15array(3) {
16  [0]=>
17  string(7) "//abcde"
18  [1]=>
19  string(6) "/abcde"
20  [2]=>
21  string(5) "abcde"
22}
23int(1)
24array(2) {
25  [0]=>
26  string(7) "//abcde"
27  [1]=>
28  string(6) "/abcde"
29}
30int(1)
31array(3) {
32  [0]=>
33  string(8) "/a/abcde"
34  [1]=>
35  string(6) "/abcde"
36  [2]=>
37  string(5) "abcde"
38}
39int(1)
40array(2) {
41  [0]=>
42  string(8) "/a/abcde"
43  [1]=>
44  string(6) "/abcde"
45}
46