Skip to content

Commit d072b91

Browse files
committed
ASCII lower case for zend_operators.c functions
For consistency with the previous change, also use ASCII lower case for zend_binary_zval_strcasecmp, zend_binary_zval_strncasecmp, string_compare_function_ex and string_case_compare_function. Only the _l suffixed functions remain locale-sensitive. I added the consequent effects to the RFC. The main reason for doing it is so that array_change_key_case() will be consistent with strtolower().
1 parent 84bda2b commit d072b91

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Zend/zend_operators.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,16 @@ static const unsigned char toupper_map[256] = {
9999
* Functions using locale lowercase:
100100
zend_binary_strncasecmp_l
101101
zend_binary_strcasecmp_l
102-
zend_binary_zval_strcasecmp
103-
zend_binary_zval_strncasecmp
102+
* Functions using ascii lowercase:
104103
string_compare_function_ex
105104
string_case_compare_function
106-
* Functions using ascii lowercase:
107105
zend_str_tolower_copy
108106
zend_str_tolower_dup
109107
zend_str_tolower
110108
zend_binary_strcasecmp
111109
zend_binary_strncasecmp
110+
zend_binary_zval_strcasecmp
111+
zend_binary_zval_strncasecmp
112112
*/
113113

114114
ZEND_API zend_long ZEND_FASTCALL zend_atol(const char *str, size_t str_len) /* {{{ */
@@ -1972,7 +1972,7 @@ ZEND_API int ZEND_FASTCALL string_compare_function_ex(zval *op1, zval *op2, bool
19721972
int ret;
19731973

19741974
if (case_insensitive) {
1975-
ret = zend_binary_strcasecmp_l(ZSTR_VAL(str1), ZSTR_LEN(str1), ZSTR_VAL(str2), ZSTR_LEN(str1));
1975+
ret = zend_binary_strcasecmp(ZSTR_VAL(str1), ZSTR_LEN(str1), ZSTR_VAL(str2), ZSTR_LEN(str1));
19761976
} else {
19771977
ret = zend_binary_strcmp(ZSTR_VAL(str1), ZSTR_LEN(str1), ZSTR_VAL(str2), ZSTR_LEN(str2));
19781978
}
@@ -2012,13 +2012,13 @@ ZEND_API int ZEND_FASTCALL string_case_compare_function(zval *op1, zval *op2) /*
20122012
if (Z_STR_P(op1) == Z_STR_P(op2)) {
20132013
return 0;
20142014
} else {
2015-
return zend_binary_strcasecmp_l(Z_STRVAL_P(op1), Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2));
2015+
return zend_binary_strcasecmp(Z_STRVAL_P(op1), Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2));
20162016
}
20172017
} else {
20182018
zend_string *tmp_str1, *tmp_str2;
20192019
zend_string *str1 = zval_get_tmp_string(op1, &tmp_str1);
20202020
zend_string *str2 = zval_get_tmp_string(op2, &tmp_str2);
2021-
int ret = zend_binary_strcasecmp_l(ZSTR_VAL(str1), ZSTR_LEN(str1), ZSTR_VAL(str2), ZSTR_LEN(str1));
2021+
int ret = zend_binary_strcasecmp(ZSTR_VAL(str1), ZSTR_LEN(str1), ZSTR_VAL(str2), ZSTR_LEN(str1));
20222022

20232023
zend_tmp_string_release(tmp_str1);
20242024
zend_tmp_string_release(tmp_str2);
@@ -3080,13 +3080,13 @@ ZEND_API int ZEND_FASTCALL zend_binary_zval_strncmp(zval *s1, zval *s2, zval *s3
30803080

30813081
ZEND_API int ZEND_FASTCALL zend_binary_zval_strcasecmp(zval *s1, zval *s2) /* {{{ */
30823082
{
3083-
return zend_binary_strcasecmp_l(Z_STRVAL_P(s1), Z_STRLEN_P(s1), Z_STRVAL_P(s2), Z_STRLEN_P(s2));
3083+
return zend_binary_strcasecmp(Z_STRVAL_P(s1), Z_STRLEN_P(s1), Z_STRVAL_P(s2), Z_STRLEN_P(s2));
30843084
}
30853085
/* }}} */
30863086

30873087
ZEND_API int ZEND_FASTCALL zend_binary_zval_strncasecmp(zval *s1, zval *s2, zval *s3) /* {{{ */
30883088
{
3089-
return zend_binary_strncasecmp_l(Z_STRVAL_P(s1), Z_STRLEN_P(s1), Z_STRVAL_P(s2), Z_STRLEN_P(s2), Z_LVAL_P(s3));
3089+
return zend_binary_strncasecmp(Z_STRVAL_P(s1), Z_STRLEN_P(s1), Z_STRVAL_P(s2), Z_STRLEN_P(s2), Z_LVAL_P(s3));
30903090
}
30913091
/* }}} */
30923092

0 commit comments

Comments
 (0)