xref: /PHP-7.4/ext/pcre/tests/null_bytes.phpt (revision 8b3c1a38)
1--TEST--
2Zero byte test
3--FILE--
4<?php
5
6preg_match("\0//i", "");
7preg_match("/\0/i", "");
8preg_match("//\0i", "");
9preg_match("//i\0", "");
10preg_match("/\\\0/i", "");
11
12preg_match("\0[]i", "");
13preg_match("[\0]i", "");
14preg_match("[]\0i", "");
15preg_match("[]i\0", "");
16preg_match("[\\\0]i", "");
17
18preg_replace("/foo/e\0/i", "echo('Eek');", "");
19
20?>
21--EXPECTF--
22Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 3
23
24Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 4
25
26Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 5
27
28Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 6
29
30Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 7
31
32Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 9
33
34Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 10
35
36Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 11
37
38Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 12
39
40Warning: preg_match(): Null byte in regex in %snull_bytes.php on line 13
41
42Warning: preg_replace(): Null byte in regex in %snull_bytes.php on line 15
43