Lines Matching refs:strstr
2 Test strstr() function
5 /* Prototype: string strstr ( string $haystack, string $needle );
10 echo "*** Testing basic functionality of strstr() ***\n";
11 var_dump( strstr("test string", "test") );
12 var_dump( strstr("test string", "string") );
13 var_dump( strstr("test string", "strin") );
14 var_dump( strstr("test string", "t s") );
15 var_dump( strstr("test string", "g") );
16 var_dump( md5(strstr("te".chr(0)."st", chr(0))) );
17 var_dump( strstr("tEst", "test") );
18 var_dump( strstr("teSt", "test") );
19 var_dump( @strstr("", "") );
20 var_dump( @strstr("a", "") );
21 var_dump( @strstr("", "a") );
24 echo "\n*** Testing strstr() with various needles ***";
66 var_dump( strstr($string, $needles[$i]) );
93 var_dump(strstr("$obj_string", "$obj_needle"));
98 var_dump( strstr($needles, $needles) ); // won't work
99 var_dump( strstr("hello?world,!$%**()%**[][[[&@#~!", "$needles[1]") ); // works
100 var_dump( strstr("hello?world,!$%**()%**[][[[&@#~!", "$needles[2]") ); // works
106 var_dump( strstr($resource1, $resource1) );
107 var_dump( strstr($resource1, $resource2) );
111 var_dump( strstr("", NULL) );
112 var_dump( strstr(NULL, NULL) );
113 var_dump( strstr("a", NULL) );
114 var_dump( strstr("/x0", "0") ); // Hexadecimal NUL
129 var_dump( strstr($string, "abcd") );
130 var_dump( strstr($string, "1234") );
135 var_dump( strstr($str, "\0") );
136 var_dump( strstr($str, NULL) );
137 var_dump( strstr($str, "0") );
144 var_dump( strstr("Hello, world", "$needle") ); // works
145 var_dump( strstr("Hello, world'S", "$needle'S") ); // works
146 var_dump( strstr("Hello, worldS", "$needleS") ); // won't work
149 var_dump( strstr("Hello, worldS", "${needle}S") ); // works
150 var_dump( strstr("Hello, worldS", "{$needle}S") ); // works
157 var_dump( strstr($str, chr(128)) );
159 var_dump( strstr($str, chr(255)) );
161 var_dump( strstr($str, chr(256)) );
164 var_dump( strstr($string, ""));
165 var_dump( strstr() ); // zero argument
166 var_dump( strstr("") ); // null argument
167 var_dump( strstr($string) ); // without "needle"
168 var_dump( strstr("a", "b", "c") ); // args > expected
169 var_dump( strstr(NULL, "") );
177 *** Testing basic functionality of strstr() ***
190 *** Testing strstr() with various needles ***
333 Warning: strstr() expects parameter 1 to be string, array given in %s on line %d
340 Warning: strstr() expects parameter 1 to be string, resource given in %s on line %d
343 Warning: strstr() expects parameter 1 to be string, resource given in %s on line %d
385 Warning: strstr(): Empty delimiter in %s on line %d
397 Warning: strstr(): Empty delimiter in %s on line %d
400 Warning: strstr() expects at least 2 parameters, 0 given in %s on line %d
403 Warning: strstr() expects at least 2 parameters, 1 given in %s on line %d
406 Warning: strstr() expects at least 2 parameters, 1 given in %s on line %d
410 Warning: strstr(): Empty delimiter in %s on line %d