Annotation of embedaddon/php/ext/pcre/tests/match_flags2.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: preg_match() flags
3: --FILE--
4: <?php
5:
6: var_dump(preg_match('/x(.)/', 'fjszxax', $match, PREG_OFFSET_CAPTURE));
7: var_dump($match);
8:
9: var_dump(preg_match('/(.)x/', 'fjszxax', $match, PREG_OFFSET_CAPTURE, 4));
10: var_dump($match);
11:
12: var_dump(preg_match('/(?P<capt1>.)(x)(?P<letsmix>\S+)/', 'fjszxax', $match, PREG_OFFSET_CAPTURE));
13: var_dump($match);
14:
15: ?>
16: --EXPECT--
17: int(1)
18: array(2) {
19: [0]=>
20: array(2) {
21: [0]=>
22: string(2) "xa"
23: [1]=>
24: int(4)
25: }
26: [1]=>
27: array(2) {
28: [0]=>
29: string(1) "a"
30: [1]=>
31: int(5)
32: }
33: }
34: int(1)
35: array(2) {
36: [0]=>
37: array(2) {
38: [0]=>
39: string(2) "ax"
40: [1]=>
41: int(5)
42: }
43: [1]=>
44: array(2) {
45: [0]=>
46: string(1) "a"
47: [1]=>
48: int(5)
49: }
50: }
51: int(1)
52: array(6) {
53: [0]=>
54: array(2) {
55: [0]=>
56: string(4) "zxax"
57: [1]=>
58: int(3)
59: }
60: ["capt1"]=>
61: array(2) {
62: [0]=>
63: string(1) "z"
64: [1]=>
65: int(3)
66: }
67: [1]=>
68: array(2) {
69: [0]=>
70: string(1) "z"
71: [1]=>
72: int(3)
73: }
74: [2]=>
75: array(2) {
76: [0]=>
77: string(1) "x"
78: [1]=>
79: int(4)
80: }
81: ["letsmix"]=>
82: array(2) {
83: [0]=>
84: string(2) "ax"
85: [1]=>
86: int(5)
87: }
88: [3]=>
89: array(2) {
90: [0]=>
91: string(2) "ax"
92: [1]=>
93: int(5)
94: }
95: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>