Lines Matching refs:strpos

2 Test strpos() function
7 echo "*** Testing basic functionality of strpos() ***\n";
8 var_dump( strpos("test string", "test") );
9 var_dump( strpos("test string", "string") );
10 var_dump( strpos("test string", "strin") );
11 var_dump( strpos("test string", "t s") );
12 var_dump( strpos("test string", "g") );
13 var_dump( strpos("te".chr(0)."st", chr(0)) );
14 var_dump( strpos("tEst", "test") );
15 var_dump( strpos("teSt", "test") );
16 var_dump( strpos("", "") );
17 var_dump( strpos("a", "") );
18 var_dump( strpos("", "a") );
19 var_dump( strpos("\\\\a", "\\a") );
22 echo "\n*** Testing strpos() to find various needles and a long string ***\n";
63 var_dump( strpos($string, $needles[$i]) );
67 echo "\n*** Testing strpos() with possible variations in offset ***\n";
85 var_dump( strpos($string, "Hello", $offset_values[$i]) );
115 var_dump( strpos("$obj_string", "$obj_needle") );
118 var_dump( strpos("", NULL) );
119 var_dump( strpos(NULL, NULL) );
120 var_dump( strpos("a", NULL) );
121 var_dump( strpos("/x0", "0") ); // Hexadecimal NUL
136 var_dump( strpos($string, "abcd") );
137 var_dump( strpos($string, "abcd", 72) ); // 72 -> "\n" in the first line
138 var_dump( strpos($string, "abcd", 73) ); // 73 -> "abcd" in the second line
139 var_dump( strpos($string, "9", (strlen($string)-1)) );
144 var_dump( strpos($str, "\0") );
145 var_dump( strpos($str, "0") );
152 var_dump( strpos("Hello, world", "$needle") ); // works
153 var_dump( strpos("Hello, world'S", "$needle'S") ); // works
154 var_dump( strpos("Hello, worldS", "$needleS") ); // won't work
157 var_dump( strpos("Hello, worldS", "${needle}S") ); // works
158 var_dump( strpos("Hello, worldS", "{$needle}S") ); // works
161 var_dump( strpos($string, "") );
163 strpos($string, "test", strlen($string)+1); // offset > strlen()
169 strpos($string, "test", -strlen($string)-1); // offset before start
178 *** Testing basic functionality of strpos() ***
192 *** Testing strpos() to find various needles and a long string ***
226 *** Testing strpos() with possible variations in offset ***
229 strpos(): Argument #3 ($offset) must be of type int, string given
231 strpos(): Argument #3 ($offset) must be of type int, string given
236 strpos(): Argument #3 ($offset) must be of type int, string given
247 Deprecated: strpos(): Passing null to parameter #2 ($needle) of type string is deprecated in %s on …
250 Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in %s o…
252 Deprecated: strpos(): Passing null to parameter #2 ($needle) of type string is deprecated in %s on …
255 Deprecated: strpos(): Passing null to parameter #2 ($needle) of type string is deprecated in %s on …
280 strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)
281 strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack)