xref: /PHP-8.3/ext/pcre/tests/delimiters.phpt (revision 5bb3e233)
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('{', ''));
15var_dump(preg_match("\0\0", ''));
16
17?>
18--EXPECTF--
19Warning: preg_match(): Empty regular expression in %sdelimiters.php on line 3
20bool(false)
21
22Warning: preg_match(): Empty regular expression in %sdelimiters.php on line 4
23bool(false)
24int(1)
25
26Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in %sdelimiters.php on line 6
27bool(false)
28int(1)
29
30Warning: preg_match(): No ending delimiter '~' found in %sdelimiters.php on line 8
31bool(false)
32int(1)
33
34Warning: preg_match(): Unknown modifier 'z' in %sdelimiters.php on line 10
35bool(false)
36
37Warning: preg_match(): No ending matching delimiter '}' found in %sdelimiters.php on line 11
38bool(false)
39
40Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL in %sdelimiters.php on line 12
41bool(false)
42