xref: /PHP-5.6/ext/pcre/tests/002.phpt (revision be202d3d)
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--
19
20Warning: preg_match() expects at least 2 parameters, 0 given in %s002.php on line 3
21bool(false)
22
23Warning: preg_match_all() expects at least 2 parameters, 0 given in %s002.php on line 4
24bool(false)
25
26Warning: preg_match_all(): Invalid flags specified in %s002.php on line 5
27NULL
28
29Warning: preg_quote() expects at least 1 parameter, 0 given in %s002.php on line 7
30NULL
31string(0) ""
32string(12) "a${1b${1c${1"
33
34Warning: preg_replace(): Compilation failed: missing terminating ] for character class at offset 8 in %s002.php on line 11
35NULL
36
37Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in %s on line 12
38
39Parse error: %s in %s002.php(12) : regexp code on line 1
40
41Fatal error: preg_replace(): Failed evaluating code:
42for ($ in %s002.php on line 12
43