Switch default semaphore to ThrottledLifoSem for CPU executors
[hiphop-php.git] / hphp / test / slow / ext_string / strpbrk_null.php
blob02f80fad5b9f92a04c7bf8e6d744ab9d91cac61b
1 <?hh
3 function prettify_null($x) :mixed{
4 return strtr($x, dict["\x00" => '<0>']);
7 function nulls_in_haystack() :mixed{
8 var_dump(
9 prettify_null(strpbrk("foo\x00bar\x00waaaaa", "w\x00")));
10 var_dump(
11 prettify_null(strpbrk("foo\x00bar\x00waaaaa", "\x00r")));
12 var_dump(
13 prettify_null(strpbrk("foo\x00bar\x00waaaaa", "w\x00r")));
14 var_dump(
15 prettify_null(strpbrk("foo\x00bar\x00waaaaaz", "\x00z\x00")));
18 function basic_tests() :mixed{
19 var_dump(prettify_null(strpbrk('foo:bar', "\0:")));
21 $invalid = "\0z";
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{
28 basic_tests();
29 nulls_in_haystack();
33 <<__EntryPoint>>
34 function main_strpbrk_null() :mixed{
35 main();