@@ -86,17 +86,15 @@ PHP_FUNCTION(grapheme_strpos)
86
86
const char * found ;
87
87
zend_long loffset = 0 ;
88
88
int32_t offset = 0 ;
89
- zend_long strength = UCOL_DEFAULT_STRENGTH ;
90
89
size_t noffset = 0 ;
91
90
zend_long ret_pos ;
92
91
93
- ZEND_PARSE_PARAMETERS_START (2 , 5 )
92
+ ZEND_PARSE_PARAMETERS_START (2 , 4 )
94
93
Z_PARAM_STRING (haystack , haystack_len )
95
94
Z_PARAM_STRING (needle , needle_len )
96
95
Z_PARAM_OPTIONAL
97
96
Z_PARAM_LONG (loffset )
98
97
Z_PARAM_STRING (locale , locale_len )
99
- Z_PARAM_LONG (strength )
100
98
ZEND_PARSE_PARAMETERS_END ();
101
99
102
100
if ( OUTSIDE_STRING (loffset , haystack_len ) ) {
@@ -124,7 +122,7 @@ PHP_FUNCTION(grapheme_strpos)
124
122
}
125
123
126
124
/* 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 */ );
128
126
129
127
if ( ret_pos >= 0 ) {
130
128
RETURN_LONG (ret_pos );
@@ -142,17 +140,15 @@ PHP_FUNCTION(grapheme_stripos)
142
140
const char * found ;
143
141
zend_long loffset = 0 ;
144
142
int32_t offset = 0 ;
145
- zend_long strength = UCOL_SECONDARY ;
146
143
zend_long ret_pos ;
147
144
int is_ascii ;
148
145
149
- ZEND_PARSE_PARAMETERS_START (2 , 5 )
146
+ ZEND_PARSE_PARAMETERS_START (2 , 4 )
150
147
Z_PARAM_STRING (haystack , haystack_len )
151
148
Z_PARAM_STRING (needle , needle_len )
152
149
Z_PARAM_OPTIONAL
153
150
Z_PARAM_LONG (loffset )
154
151
Z_PARAM_STRING (locale , locale_len )
155
- Z_PARAM_LONG (strength )
156
152
ZEND_PARSE_PARAMETERS_END ();
157
153
158
154
if ( OUTSIDE_STRING (loffset , haystack_len ) ) {
@@ -191,7 +187,7 @@ PHP_FUNCTION(grapheme_stripos)
191
187
}
192
188
193
189
/* 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 */ );
195
191
196
192
if ( ret_pos >= 0 ) {
197
193
RETURN_LONG (ret_pos );
@@ -210,17 +206,15 @@ PHP_FUNCTION(grapheme_strrpos)
210
206
size_t haystack_len , needle_len , locale_len ;
211
207
zend_long loffset = 0 ;
212
208
int32_t offset = 0 ;
213
- zend_long strength = UCOL_DEFAULT_STRENGTH ;
214
209
zend_long ret_pos ;
215
210
int is_ascii ;
216
211
217
- ZEND_PARSE_PARAMETERS_START (2 , 5 )
212
+ ZEND_PARSE_PARAMETERS_START (2 , 4 )
218
213
Z_PARAM_STRING (haystack , haystack_len )
219
214
Z_PARAM_STRING (needle , needle_len )
220
215
Z_PARAM_OPTIONAL
221
216
Z_PARAM_LONG (loffset )
222
217
Z_PARAM_STRING (locale , locale_len )
223
- Z_PARAM_LONG (strength )
224
218
ZEND_PARSE_PARAMETERS_END ();
225
219
226
220
if ( OUTSIDE_STRING (loffset , haystack_len ) ) {
@@ -252,7 +246,7 @@ PHP_FUNCTION(grapheme_strrpos)
252
246
/* else we need to continue via utf16 */
253
247
}
254
248
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 */ );
256
250
257
251
if ( ret_pos >= 0 ) {
258
252
RETURN_LONG (ret_pos );
@@ -271,17 +265,15 @@ PHP_FUNCTION(grapheme_strripos)
271
265
size_t haystack_len , needle_len , locale_len = 0 ;
272
266
zend_long loffset = 0 ;
273
267
int32_t offset = 0 ;
274
- zend_long strength = UCOL_SECONDARY ;
275
268
zend_long ret_pos ;
276
269
int is_ascii ;
277
270
278
- ZEND_PARSE_PARAMETERS_START (2 , 5 )
271
+ ZEND_PARSE_PARAMETERS_START (2 , 4 )
279
272
Z_PARAM_STRING (haystack , haystack_len )
280
273
Z_PARAM_STRING (needle , needle_len )
281
274
Z_PARAM_OPTIONAL
282
275
Z_PARAM_LONG (loffset )
283
276
Z_PARAM_STRING (locale , locale_len )
284
- Z_PARAM_LONG (strength )
285
277
ZEND_PARSE_PARAMETERS_END ();
286
278
287
279
if ( OUTSIDE_STRING (loffset , haystack_len ) ) {
@@ -322,7 +314,7 @@ PHP_FUNCTION(grapheme_strripos)
322
314
/* else we need to continue via utf16 */
323
315
}
324
316
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 */ );
326
318
327
319
if ( ret_pos >= 0 ) {
328
320
RETURN_LONG (ret_pos );
@@ -344,7 +336,6 @@ PHP_FUNCTION(grapheme_substr)
344
336
int32_t ustr_len ;
345
337
zend_long lstart = 0 , length = 0 ;
346
338
int32_t start = 0 ;
347
- zend_long strength = UCOL_DEFAULT ;
348
339
int iter_val ;
349
340
UErrorCode status ;
350
341
unsigned char u_break_iterator_buffer [U_BRK_SAFECLONE_BUFFERSIZE ];
@@ -353,13 +344,12 @@ PHP_FUNCTION(grapheme_substr)
353
344
int32_t (* iter_func )(UBreakIterator * );
354
345
bool no_length = true;
355
346
356
- ZEND_PARSE_PARAMETERS_START (2 , 5 )
347
+ ZEND_PARSE_PARAMETERS_START (2 , 4 )
357
348
Z_PARAM_STRING (str , str_len )
358
349
Z_PARAM_LONG (lstart )
359
350
Z_PARAM_OPTIONAL
360
351
Z_PARAM_LONG_OR_NULL (length , no_length )
361
352
Z_PARAM_STRING (locale , locale_len )
362
- Z_PARAM_LONG (strength )
363
353
ZEND_PARSE_PARAMETERS_END ();
364
354
365
355
if (lstart < INT32_MIN || lstart > INT32_MAX ) {
@@ -557,22 +547,14 @@ static void strstr_common_handler(INTERNAL_FUNCTION_PARAMETERS, int f_ignore_cas
557
547
const char * found ;
558
548
size_t haystack_len , needle_len , locale_len = 0 ;
559
549
int32_t ret_pos , uchar_pos ;
560
- zend_long strength ;
561
550
bool part = false;
562
551
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 )
570
553
Z_PARAM_STRING (haystack , haystack_len )
571
554
Z_PARAM_STRING (needle , needle_len )
572
555
Z_PARAM_OPTIONAL
573
556
Z_PARAM_BOOL (part )
574
557
Z_PARAM_STRING (locale , locale_len )
575
- Z_PARAM_LONG (strength )
576
558
ZEND_PARSE_PARAMETERS_END ();
577
559
578
560
if ( !f_ignore_case ) {
@@ -599,7 +581,7 @@ static void strstr_common_handler(INTERNAL_FUNCTION_PARAMETERS, int f_ignore_cas
599
581
}
600
582
601
583
/* 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 */ );
603
585
604
586
if ( ret_pos < 0 ) {
605
587
RETURN_FALSE ;
@@ -946,17 +928,15 @@ PHP_FUNCTION(grapheme_levenshtein)
946
928
zend_long cost_del = 1 ;
947
929
char * locale = "" ;
948
930
size_t locale_len = 0 ;
949
- zend_long strength = UCOL_DEFAULT_STRENGTH ;
950
931
951
- ZEND_PARSE_PARAMETERS_START (2 , 7 )
932
+ ZEND_PARSE_PARAMETERS_START (2 , 6 )
952
933
Z_PARAM_STR (string1 )
953
934
Z_PARAM_STR (string2 )
954
935
Z_PARAM_OPTIONAL
955
936
Z_PARAM_LONG (cost_ins )
956
937
Z_PARAM_LONG (cost_rep )
957
938
Z_PARAM_LONG (cost_del )
958
939
Z_PARAM_STRING (locale , locale_len )
959
- Z_PARAM_LONG (strength )
960
940
ZEND_PARSE_PARAMETERS_END ();
961
941
962
942
if (cost_ins <= 0 || cost_ins > UINT_MAX / 4 ) {
@@ -1081,7 +1061,6 @@ PHP_FUNCTION(grapheme_levenshtein)
1081
1061
RETVAL_FALSE ;
1082
1062
goto out_collator ;
1083
1063
}
1084
- ucol_setStrength (collator , strength );
1085
1064
1086
1065
zend_long * p1 , * p2 , * tmp ;
1087
1066
p1 = safe_emalloc ((size_t ) strlen_2 + 1 , sizeof (zend_long ), 0 );
0 commit comments