xref: /PHP-8.1/ext/pcre/tests/delimiters.phpt (revision 4ee2074d)
1--TEST--
2Delimiters crash test
3--FILE--
4<?php
5
6var_dump(preg_match('', ''));
7var_dump(preg_match('      ', ''));
8var_dump(preg_match('@@', ''));
9var_dump(preg_match('12', ''));
10var_dump(preg_match('<>', ''));
11var_dump(preg_match('~a', ''));
12var_dump(preg_match('@\@\@@', '@@'));
13var_dump(preg_match('//z', '@@'));
14var_dump(preg_match('{', ''));
15
16?>
17--EXPECTF--
18Warning: preg_match(): Empty regular expression in %sdelimiters.php on line 3
19bool(false)
20
21Warning: preg_match(): Empty regular expression in %sdelimiters.php on line 4
22bool(false)
23int(1)
24
25Warning: preg_match(): Delimiter must not be alphanumeric or backslash in %sdelimiters.php on line 6
26bool(false)
27int(1)
28
29Warning: preg_match(): No ending delimiter '~' found in %sdelimiters.php on line 8
30bool(false)
31int(1)
32
33Warning: preg_match(): Unknown modifier 'z' in %sdelimiters.php on line 10
34bool(false)
35
36Warning: preg_match(): No ending matching delimiter '}' found in %sdelimiters.php on line 11
37bool(false)
38