xref: /PHP-7.0/ext/pcre/tests/match_flags3.phpt (revision 23917b45)
1--TEST--
2preg_match() flags 3
3--FILE--
4<?php
5
6var_dump(preg_match('', '', $match, 0xfff));
7
8var_dump(preg_match('/\d+/', '123 456 789 012', $match, 0, -8));
9var_dump($match);
10
11var_dump(preg_match('/\d+/', '123 456 789 012', $match, 0, -500));
12var_dump($match);
13
14var_dump(preg_match_all('/\d+/', '123 456 789 012', $match, 0, -8));
15var_dump($match);
16
17var_dump(preg_match('/(?P<3>)/', ''));
18
19?>
20--EXPECTF--
21
22Warning: preg_match(): Empty regular expression in %smatch_flags3.php on line 3
23bool(false)
24int(1)
25array(1) {
26  [0]=>
27  string(3) "789"
28}
29int(1)
30array(1) {
31  [0]=>
32  string(3) "123"
33}
34int(2)
35array(1) {
36  [0]=>
37  array(2) {
38    [0]=>
39    string(3) "789"
40    [1]=>
41    string(3) "012"
42  }
43}
44
45Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset %d in %smatch_flags3.php on line %d
46bool(false)
47