Home
last modified time | relevance | path

Searched refs:needle (Results 26 – 50 of 107) sorted by last modified time

12345

/php-src/ext/mbstring/tests/
H A Dmb_substr_count.phpt11 print "== Empty needle should raise an error ==\n";
23 // Although the needle below contains 3 bytes, it decodes to zero Unicode codepoints
24 // So the needle is actually 'empty', although it doesn't appear so
58 // cached data), and both of those codepoints matched a 1-codepoint needle
64 // needle, that match would be disregarded and not counted in the returned value
71 == Empty needle should raise an error ==
72 mb_substr_count(): Argument #2 ($needle) must not be empty
73 mb_substr_count(): Argument #2 ($needle) must not be empty
74 mb_substr_count(): Argument #2 ($needle) must not be empty
H A Dmb_strrchr_basic.phpt15 echo "\n-- ASCII string: needle exists --\n";
20 echo "\n-- ASCII string: needle doesn't exist --\n";
23 echo "\n-- Multibyte string: needle exists --\n";
29 echo "\n-- Multibyte string: needle doesn't exist --\n";
41 -- ASCII string: needle exists --
46 -- ASCII string: needle doesn't exist --
49 -- Multibyte string: needle exists --
54 -- Multibyte string: needle doesn't exist --
/php-src/ext/standard/tests/strings/
H A Dstrpos.phpt60 /* loop through to get the "needle" position in $string */
81 /* loop through to get the "needle" position in $string */
94 echo "-- Passing objects as string and needle --\n";
107 class needle
113 $obj_needle = new needle;
149 $needle = 'world';
152 var_dump( strpos("Hello, world", "$needle") ); // works
153 var_dump( strpos("Hello, world'S", "$needle'S") ); // works
157 var_dump( strpos("Hello, worldS", "${needle}S") ); // works
158 var_dump( strpos("Hello, worldS", "{$needle}S") ); // works
[all …]
H A Dstrrchr_variation1.phpt6 /* Test strrchr() function by passing various double quoted strings for 'haystack' & 'needle' */
10 $needle = array(
65 42, //needle as int(ASCII value of "*")
66 $haystack //haystack as needle
69 /* loop through to get the position of the needle in haystack string */
71 for($index=0; $index<count($needle); $index++) {
73 var_dump( strrchr($haystack, $needle[$index]) );
H A Dstrrchr_variation12.phpt19 //needle as null string
21 //needle as empty string
H A Dstrrchr_variation2.phpt5 /* Test strrchr() function by passing various single quoted strings to 'haystack' & 'needle' */
9 $needle = array(
64 42, //needle as int(ASCII value of '*')
65 $haystack //haystack as needle
68 /* loop through to get the position of the needle in haystack string */
70 for($index=0; $index<count($needle); $index++) {
72 var_dump( strrchr($haystack, $needle[$index]) );
H A Dstrrchr_variation3.phpt20 $multi_line_str //needle as haystack
23 //loop through to test strrchr() with each needle
24 foreach($needles as $needle) {
25 var_dump( strrchr($multi_line_str, $needle) );
H A Dstrrchr_variation4.phpt26 $heredoc_needle, //needle as heredoc string
27 $special_chars_str //needle as haystack
30 //loop through to test strrchr() with each needle
31 foreach($needles as $needle) {
32 var_dump( strrchr($special_chars_str, $needle) );
H A Dstrrchr_variation5.phpt5 /* Prototype : string strrchr(string $haystack, string $needle);
25 $escape_char_str //needle as haystack
28 //loop through to test strrchr() with each needle
29 foreach($needles as $needle) {
30 var_dump( strrchr($escape_char_str, $needle) );
H A Dstrrchr_variation6.phpt21 $quote_char_str //needle as haystack
24 //loop through to test strrchr() with each needle
25 foreach($needles as $needle) {
26 var_dump( strrchr($quote_char_str, $needle) );
H A Dstrrchr_variation7.phpt21 $blank_line //needle as haystack
24 //loop through to test strrchr() with each needle
25 foreach($needles as $needle) {
26 var_dump( strrchr($blank_line, $needle) );
H A Dstrripos_basic1.phpt10 echo "\n-- regular string for haystack & needle --\n";
17 echo "\n-- single char for needle --\n";
21 echo "\n-- heredoc string for haystack & needle --\n";
30 -- regular string for haystack & needle --
37 -- single char for needle --
41 -- heredoc string for haystack & needle --
H A Dstrripos_basic2.phpt10 echo "\n-- regular string for haystack & needle, with various offsets --\n";
16 echo "\n-- heredoc string for haystack & needle, with various offsets --\n";
36 -- regular string for haystack & needle, with various offsets --
42 -- heredoc string for haystack & needle, with various offsets --
H A Dstrripos_variation1.phpt2 Test strripos() function : usage variations - double quoted strings for 'haystack' & 'needle' argum…
5 /* Test strripos() function by passing double quoted strings for 'haystack' & 'needle' arguments */
55 $haystack //haystack as needle
58 /* loop through to get the position of the needle in haystack string */
60 foreach ($needles as $needle) {
62 var_dump( strripos($haystack, $needle) );
63 var_dump( strripos($haystack, $needle, 1) );
64 var_dump( strripos($haystack, $needle, 20) );
65 var_dump( strripos($haystack, $needle, -1) );
H A Dstrripos_variation2.phpt2 Test strripos() function : usage variations - single quoted strings for 'haystack' & 'needle' argum…
5 /* Test strripos() function by passing single quoted strings to 'haystack' & 'needle' arguments */
55 42, //needle as int(ASCII value of '*')
56 $haystack //haystack as needle
59 /* loop through to get the position of the needle in haystack string */
61 foreach ($needles as $needle) {
63 var_dump( strripos($haystack, $needle) );
64 var_dump( strripos($haystack, $needle, 1) );
65 var_dump( strripos($haystack, $needle, 20) );
66 var_dump( strripos($haystack, $needle, -1) );
H A Dstrrpos_basic1.phpt11 //regular string for haystack & needle
17 //single char for needle
21 //heredoc string for haystack & needle
H A Dstrrpos_variation14.phpt2 Test strrpos() function : usage variations - negative offset with empty needle
H A Dstrrpos_variation2.phpt2 Test strrpos() function : usage variations - single quoted strings for 'haystack' & 'needle' argume…
5 /* Test strrpos() function by passing single quoted strings to 'haystack' & 'needle' arguments */
9 $needle = array(
55 42, //needle as int(ASCII value of '*')
56 $haystack //haystack as needle
59 /* loop through to get the position of the needle in haystack string */
61 for($index=0; $index<count($needle); $index++) {
63 var_dump( strrpos($haystack, $needle[$index]) );
64 var_dump( strrpos($haystack, $needle[$index], $index) );
H A Dstrrpos_variation8.phpt5 /* Test strrpos() function with strings containing multiple occurrences of 'needle' in the 'haystac…
11 $needle = "aba";
13 /* loop through to consider various offsets in getting the position of the needle in haystack strin…
17 var_dump( strrpos($haystack, $needle, $offset) );
H A Dstrstr.phpt24 /* needles in an array to get the string starts with needle, in $string */
57 /* loop through to get the string starts with "needle" in $string */
66 echo "-- Passing objects as string and needle --\n";
79 class needle
85 $obj_needle = new needle;
120 $needle = 'world';
123 var_dump( strstr("Hello, world", "$needle") ); // works
124 var_dump( strstr("Hello, world'S", "$needle'S") ); // works
128 var_dump( strstr("Hello, worldS", "${needle}S") ); // works
129 var_dump( strstr("Hello, worldS", "{$needle}S") ); // works
[all …]
H A Dsubstr_count_basic.phpt37 substr_count(): Argument #2 ($needle) cannot be empty
38 substr_count(): Argument #2 ($needle) cannot be empty
H A Dstrripos_variation6.phpt2 Test strrpos() function : usage variations - negative offset with empty needle
H A Dstrrpos_basic2.phpt11 //regular string for haystack & needle, with various offsets
17 //heredoc string for haystack & needle, with various offsets
H A Dstrrpos_variation13.phpt2 Test strrpos() function : usage variations - checking bianry safe with 'needle' argument
5 /* Test strrpos() function with null terminated strings for 'needle' argument
H A Dstripos_variation2.phpt2 Test stripos() function : usage variations - single quoted strings for 'haystack' & 'needle' argume…
5 /* Test stripos() function by passing single quoted strings to 'haystack' & 'needle' arguments */
9 $needle = array(
65 42, //needle as int(ASCII value of '*')
66 $haystack //haystack as needle
69 /* loop through to get the position of the needle in haystack string */
71 for($index=0; $index<count($needle); $index++) {
73 var_dump( stripos($haystack, $needle[$index]) );
74 var_dump( stripos($haystack, $needle[$index], $index) );

Completed in 103 milliseconds

12345