xref: /php-src/ext/pcre/tests/match_flags3.phpt (revision c421d9af)
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--
21Warning: preg_match(): Empty regular expression in %smatch_flags3.php on line 3
22bool(false)
23int(1)
24array(1) {
25  [0]=>
26  string(3) "789"
27}
28int(1)
29array(1) {
30  [0]=>
31  string(3) "123"
32}
33int(2)
34array(1) {
35  [0]=>
36  array(2) {
37    [0]=>
38    string(3) "789"
39    [1]=>
40    string(3) "012"
41  }
42}
43
44Warning: preg_match(): Compilation failed: %s name must start with a non-digit at offset %d in %smatch_flags3.php on line %d
45bool(false)
46