xref: /PHP-7.3/ext/pcre/tests/002.phpt (revision b746e698)
1--TEST--
2preg_* with bogus vals
3--FILE--
4<?php
5
6var_dump(preg_match());
7var_dump(preg_match_all());
8var_dump(preg_match_all('//', '', $dummy, 0xdead));
9
10var_dump(preg_quote());
11var_dump(preg_quote(''));
12
13var_dump(preg_replace('/(.)/', '${1}${1', 'abc'));
14var_dump(preg_replace('/.++\d*+[/', 'for ($', 'abc'));
15var_dump(preg_replace('/(.)/e', 'for ($', 'abc'));
16
17?>
18--EXPECTF--
19Warning: preg_match() expects at least 2 parameters, 0 given in %s002.php on line 3
20bool(false)
21
22Warning: preg_match_all() expects at least 2 parameters, 0 given in %s002.php on line 4
23bool(false)
24
25Warning: preg_match_all(): Invalid flags specified in %s002.php on line 5
26NULL
27
28Warning: preg_quote() expects at least 1 parameter, 0 given in %s002.php on line 7
29NULL
30string(0) ""
31string(12) "a${1b${1c${1"
32
33Warning: preg_replace(): Compilation failed: missing terminating ] for character class at offset 8 in %s002.php on line 11
34NULL
35
36Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in %s on line 12
37NULL
38