From 498674058c7c77e5e7d86c00c20b39f530a8b801 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 24 Sep 2021 09:38:08 +0200 Subject: [PATCH] Remove zend_binary_zval_strcasecmp() APIs These are thin wrappers ... around the wrong functions. They call the "_l()" version of the underlying APIs. For clarify, just call the wrapped API directly. --- UPGRADING.INTERNALS | 5 +++++ Zend/zend_operators.c | 14 -------------- Zend/zend_operators.h | 2 -- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 18a6239410e..b5d6f0be53d 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -10,6 +10,11 @@ PHP 8.2 INTERNALS UPGRADE NOTES 1. Internal API changes ======================== +* Removed zend_binary_zval_str(n)casecmp() APIs. These were thin wrappers + around zend_binary_str(n)casecmp_l() -- rather than + zend_binary_str(n)casecmp() as one would expect. Call the appropriate + wrapped function directly instead. + ======================== 2. Build system changes ======================== diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index f1846030b94..a6488e53292 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -79,8 +79,6 @@ static const unsigned char tolower_map[256] = { * Functions using locale lowercase: zend_binary_strncasecmp_l zend_binary_strcasecmp_l - zend_binary_zval_strcasecmp - zend_binary_zval_strncasecmp string_compare_function_ex string_case_compare_function * Functions using ascii lowercase: @@ -2919,18 +2917,6 @@ ZEND_API int ZEND_FASTCALL zend_binary_zval_strncmp(zval *s1, zval *s2, zval *s3 } /* }}} */ -ZEND_API int ZEND_FASTCALL zend_binary_zval_strcasecmp(zval *s1, zval *s2) /* {{{ */ -{ - return zend_binary_strcasecmp_l(Z_STRVAL_P(s1), Z_STRLEN_P(s1), Z_STRVAL_P(s2), Z_STRLEN_P(s2)); -} -/* }}} */ - -ZEND_API int ZEND_FASTCALL zend_binary_zval_strncasecmp(zval *s1, zval *s2, zval *s3) /* {{{ */ -{ - 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)); -} -/* }}} */ - ZEND_API bool ZEND_FASTCALL zendi_smart_streq(zend_string *s1, zend_string *s2) /* {{{ */ { zend_uchar ret1, ret2; diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index 5610d34dedb..c92456fb1a3 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -443,8 +443,6 @@ ZEND_API zend_string* ZEND_FASTCALL zend_string_tolower_ex(zend_string *str, boo ZEND_API int ZEND_FASTCALL zend_binary_zval_strcmp(zval *s1, zval *s2); ZEND_API int ZEND_FASTCALL zend_binary_zval_strncmp(zval *s1, zval *s2, zval *s3); -ZEND_API int ZEND_FASTCALL zend_binary_zval_strcasecmp(zval *s1, zval *s2); -ZEND_API int ZEND_FASTCALL zend_binary_zval_strncasecmp(zval *s1, zval *s2, zval *s3); ZEND_API int ZEND_FASTCALL zend_binary_strcmp(const char *s1, size_t len1, const char *s2, size_t len2); ZEND_API int ZEND_FASTCALL zend_binary_strncmp(const char *s1, size_t len1, const char *s2, size_t len2, size_t length); ZEND_API int ZEND_FASTCALL zend_binary_strcasecmp(const char *s1, size_t len1, const char *s2, size_t len2);