@@ -86,17 +86,15 @@ PHP_FUNCTION(grapheme_strpos)
8686 const char * found ;
8787 zend_long loffset = 0 ;
8888 int32_t offset = 0 ;
89- zend_long strength = UCOL_DEFAULT_STRENGTH ;
9089 size_t noffset = 0 ;
9190 zend_long ret_pos ;
9291
93- ZEND_PARSE_PARAMETERS_START (2 , 5 )
92+ ZEND_PARSE_PARAMETERS_START (2 , 4 )
9493 Z_PARAM_STRING (haystack , haystack_len )
9594 Z_PARAM_STRING (needle , needle_len )
9695 Z_PARAM_OPTIONAL
9796 Z_PARAM_LONG (loffset )
9897 Z_PARAM_STRING (locale , locale_len )
99- Z_PARAM_LONG (strength )
10098 ZEND_PARSE_PARAMETERS_END ();
10199
102100 if ( OUTSIDE_STRING (loffset , haystack_len ) ) {
@@ -124,7 +122,7 @@ PHP_FUNCTION(grapheme_strpos)
124122 }
125123
126124 /* do utf16 part of the strpos */
127- ret_pos = grapheme_strpos_utf16 (haystack , haystack_len , needle , needle_len , offset , NULL , 0 /* fIgnoreCase */ , 0 , locale , strength /* last */ );
125+ ret_pos = grapheme_strpos_utf16 (haystack , haystack_len , needle , needle_len , offset , NULL , 0 /* fIgnoreCase */ , 0 , locale /* last */ );
128126
129127 if ( ret_pos >= 0 ) {
130128 RETURN_LONG (ret_pos );
@@ -142,17 +140,15 @@ PHP_FUNCTION(grapheme_stripos)
142140 const char * found ;
143141 zend_long loffset = 0 ;
144142 int32_t offset = 0 ;
145- zend_long strength = UCOL_SECONDARY ;
146143 zend_long ret_pos ;
147144 int is_ascii ;
148145
149- ZEND_PARSE_PARAMETERS_START (2 , 5 )
146+ ZEND_PARSE_PARAMETERS_START (2 , 4 )
150147 Z_PARAM_STRING (haystack , haystack_len )
151148 Z_PARAM_STRING (needle , needle_len )
152149 Z_PARAM_OPTIONAL
153150 Z_PARAM_LONG (loffset )
154151 Z_PARAM_STRING (locale , locale_len )
155- Z_PARAM_LONG (strength )
156152 ZEND_PARSE_PARAMETERS_END ();
157153
158154 if ( OUTSIDE_STRING (loffset , haystack_len ) ) {
@@ -191,7 +187,7 @@ PHP_FUNCTION(grapheme_stripos)
191187 }
192188
193189 /* do utf16 part of the strpos */
194- ret_pos = grapheme_strpos_utf16 (haystack , haystack_len , needle , needle_len , offset , NULL , 1 /* fIgnoreCase */ , 0 , locale , strength /*last */ );
190+ ret_pos = grapheme_strpos_utf16 (haystack , haystack_len , needle , needle_len , offset , NULL , 1 /* fIgnoreCase */ , 0 , locale /*last */ );
195191
196192 if ( ret_pos >= 0 ) {
197193 RETURN_LONG (ret_pos );
@@ -210,17 +206,15 @@ PHP_FUNCTION(grapheme_strrpos)
210206 size_t haystack_len , needle_len , locale_len ;
211207 zend_long loffset = 0 ;
212208 int32_t offset = 0 ;
213- zend_long strength = UCOL_DEFAULT_STRENGTH ;
214209 zend_long ret_pos ;
215210 int is_ascii ;
216211
217- ZEND_PARSE_PARAMETERS_START (2 , 5 )
212+ ZEND_PARSE_PARAMETERS_START (2 , 4 )
218213 Z_PARAM_STRING (haystack , haystack_len )
219214 Z_PARAM_STRING (needle , needle_len )
220215 Z_PARAM_OPTIONAL
221216 Z_PARAM_LONG (loffset )
222217 Z_PARAM_STRING (locale , locale_len )
223- Z_PARAM_LONG (strength )
224218 ZEND_PARSE_PARAMETERS_END ();
225219
226220 if ( OUTSIDE_STRING (loffset , haystack_len ) ) {
@@ -252,7 +246,7 @@ PHP_FUNCTION(grapheme_strrpos)
252246 /* else we need to continue via utf16 */
253247 }
254248
255- ret_pos = grapheme_strpos_utf16 (haystack , haystack_len , needle , needle_len , offset , NULL , 0 /* f_ignore_case */ , 1 , locale , strength /* last */ );
249+ ret_pos = grapheme_strpos_utf16 (haystack , haystack_len , needle , needle_len , offset , NULL , 0 /* f_ignore_case */ , 1 , locale /* last */ );
256250
257251 if ( ret_pos >= 0 ) {
258252 RETURN_LONG (ret_pos );
@@ -271,17 +265,15 @@ PHP_FUNCTION(grapheme_strripos)
271265 size_t haystack_len , needle_len , locale_len = 0 ;
272266 zend_long loffset = 0 ;
273267 int32_t offset = 0 ;
274- zend_long strength = UCOL_SECONDARY ;
275268 zend_long ret_pos ;
276269 int is_ascii ;
277270
278- ZEND_PARSE_PARAMETERS_START (2 , 5 )
271+ ZEND_PARSE_PARAMETERS_START (2 , 4 )
279272 Z_PARAM_STRING (haystack , haystack_len )
280273 Z_PARAM_STRING (needle , needle_len )
281274 Z_PARAM_OPTIONAL
282275 Z_PARAM_LONG (loffset )
283276 Z_PARAM_STRING (locale , locale_len )
284- Z_PARAM_LONG (strength )
285277 ZEND_PARSE_PARAMETERS_END ();
286278
287279 if ( OUTSIDE_STRING (loffset , haystack_len ) ) {
@@ -322,7 +314,7 @@ PHP_FUNCTION(grapheme_strripos)
322314 /* else we need to continue via utf16 */
323315 }
324316
325- ret_pos = grapheme_strpos_utf16 (haystack , haystack_len , needle , needle_len , offset , NULL , 1 /* f_ignore_case */ , 1 , locale , strength /*last */ );
317+ ret_pos = grapheme_strpos_utf16 (haystack , haystack_len , needle , needle_len , offset , NULL , 1 /* f_ignore_case */ , 1 , locale /*last */ );
326318
327319 if ( ret_pos >= 0 ) {
328320 RETURN_LONG (ret_pos );
@@ -344,7 +336,6 @@ PHP_FUNCTION(grapheme_substr)
344336 int32_t ustr_len ;
345337 zend_long lstart = 0 , length = 0 ;
346338 int32_t start = 0 ;
347- zend_long strength = UCOL_DEFAULT ;
348339 int iter_val ;
349340 UErrorCode status ;
350341 unsigned char u_break_iterator_buffer [U_BRK_SAFECLONE_BUFFERSIZE ];
@@ -353,13 +344,12 @@ PHP_FUNCTION(grapheme_substr)
353344 int32_t (* iter_func )(UBreakIterator * );
354345 bool no_length = true;
355346
356- ZEND_PARSE_PARAMETERS_START (2 , 5 )
347+ ZEND_PARSE_PARAMETERS_START (2 , 4 )
357348 Z_PARAM_STRING (str , str_len )
358349 Z_PARAM_LONG (lstart )
359350 Z_PARAM_OPTIONAL
360351 Z_PARAM_LONG_OR_NULL (length , no_length )
361352 Z_PARAM_STRING (locale , locale_len )
362- Z_PARAM_LONG (strength )
363353 ZEND_PARSE_PARAMETERS_END ();
364354
365355 if (lstart < INT32_MIN || lstart > INT32_MAX ) {
@@ -557,22 +547,14 @@ static void strstr_common_handler(INTERNAL_FUNCTION_PARAMETERS, int f_ignore_cas
557547 const char * found ;
558548 size_t haystack_len , needle_len , locale_len = 0 ;
559549 int32_t ret_pos , uchar_pos ;
560- zend_long strength ;
561550 bool part = false;
562551
563- if (f_ignore_case ) {
564- strength = UCOL_SECONDARY ;
565- } else {
566- strength = UCOL_DEFAULT_STRENGTH ;
567- }
568-
569- ZEND_PARSE_PARAMETERS_START (2 , 5 )
552+ ZEND_PARSE_PARAMETERS_START (2 , 4 )
570553 Z_PARAM_STRING (haystack , haystack_len )
571554 Z_PARAM_STRING (needle , needle_len )
572555 Z_PARAM_OPTIONAL
573556 Z_PARAM_BOOL (part )
574557 Z_PARAM_STRING (locale , locale_len )
575- Z_PARAM_LONG (strength )
576558 ZEND_PARSE_PARAMETERS_END ();
577559
578560 if ( !f_ignore_case ) {
@@ -599,7 +581,7 @@ static void strstr_common_handler(INTERNAL_FUNCTION_PARAMETERS, int f_ignore_cas
599581 }
600582
601583 /* need to work in utf16 */
602- ret_pos = grapheme_strpos_utf16 (haystack , haystack_len , needle , needle_len , 0 , & uchar_pos , f_ignore_case , 0 , locale , strength /*last */ );
584+ ret_pos = grapheme_strpos_utf16 (haystack , haystack_len , needle , needle_len , 0 , & uchar_pos , f_ignore_case , 0 , locale /*last */ );
603585
604586 if ( ret_pos < 0 ) {
605587 RETURN_FALSE ;
@@ -946,17 +928,15 @@ PHP_FUNCTION(grapheme_levenshtein)
946928 zend_long cost_del = 1 ;
947929 char * locale = "" ;
948930 size_t locale_len = 0 ;
949- zend_long strength = UCOL_DEFAULT_STRENGTH ;
950931
951- ZEND_PARSE_PARAMETERS_START (2 , 7 )
932+ ZEND_PARSE_PARAMETERS_START (2 , 6 )
952933 Z_PARAM_STR (string1 )
953934 Z_PARAM_STR (string2 )
954935 Z_PARAM_OPTIONAL
955936 Z_PARAM_LONG (cost_ins )
956937 Z_PARAM_LONG (cost_rep )
957938 Z_PARAM_LONG (cost_del )
958939 Z_PARAM_STRING (locale , locale_len )
959- Z_PARAM_LONG (strength )
960940 ZEND_PARSE_PARAMETERS_END ();
961941
962942 if (cost_ins <= 0 || cost_ins > UINT_MAX / 4 ) {
@@ -1081,7 +1061,6 @@ PHP_FUNCTION(grapheme_levenshtein)
10811061 RETVAL_FALSE ;
10821062 goto out_collator ;
10831063 }
1084- ucol_setStrength (collator , strength );
10851064
10861065 zend_long * p1 , * p2 , * tmp ;
10871066 p1 = safe_emalloc ((size_t ) strlen_2 + 1 , sizeof (zend_long ), 0 );
0 commit comments