3 function prettify_null($x) :mixed{
4 return strtr($x, dict
["\x00" => '<0>']);
7 function nulls_in_haystack() :mixed{
9 prettify_null(strpbrk("foo\x00bar\x00waaaaa", "w\x00")));
11 prettify_null(strpbrk("foo\x00bar\x00waaaaa", "\x00r")));
13 prettify_null(strpbrk("foo\x00bar\x00waaaaa", "w\x00r")));
15 prettify_null(strpbrk("foo\x00bar\x00waaaaaz", "\x00z\x00")));
18 function basic_tests() :mixed{
19 var_dump(prettify_null(strpbrk('foo:bar', "\0:")));
22 var_dump(prettify_null(strpbrk('foo:bar'."\0".'hurr', $invalid)));
23 var_dump(prettify_null(strpbrk('foo:bazz'."\0".'hurr', $invalid)));
24 var_dump(prettify_null('foo:bazz'."\0".'hurr', "\0"));
27 function main() :mixed{
34 function main_strpbrk_null() :mixed{