diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index cec93564065..28fcb5e5a95 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -29,6 +29,12 @@ PHP 8.2 INTERNALS UPGRADE NOTES 3. Module changes ======================== + a. ext/standard + - The PHP APIs string_natural_compare_function_ex(), + string_natural_case_compare_function(), and string_natural_compare_function() + have been removed. They always returned SUCCESS and were a wrapper around + strnatcmp_ex(). Use strnatcmp_ex() directly instead. + ======================== 4. OpCode changes ======================== diff --git a/ext/standard/php_string.h b/ext/standard/php_string.h index f795e4e2b69..0f31ff1e428 100644 --- a/ext/standard/php_string.h +++ b/ext/standard/php_string.h @@ -59,10 +59,6 @@ PHPAPI void php_explode(const zend_string *delim, zend_string *str, zval *return PHPAPI size_t php_strspn(const char *s1, const char *s2, const char *s1_end, const char *s2_end); PHPAPI size_t php_strcspn(const char *s1, const char *s2, const char *s1_end, const char *s2_end); -PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, bool case_insensitive); -PHPAPI int string_natural_compare_function(zval *result, zval *op1, zval *op2); -PHPAPI int string_natural_case_compare_function(zval *result, zval *op1, zval *op2); - #if defined(_REENTRANT) # ifdef PHP_WIN32 # include diff --git a/ext/standard/string.c b/ext/standard/string.c index 826fa338be0..ce461cab212 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -5406,32 +5406,6 @@ static void php_strnatcmp(INTERNAL_FUNCTION_PARAMETERS, int fold_case) } /* }}} */ -PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, bool case_insensitive) /* {{{ */ -{ - zend_string *tmp_str1, *tmp_str2; - zend_string *str1 = zval_get_tmp_string(op1, &tmp_str1); - zend_string *str2 = zval_get_tmp_string(op2, &tmp_str2); - - ZVAL_LONG(result, strnatcmp_ex(ZSTR_VAL(str1), ZSTR_LEN(str1), ZSTR_VAL(str2), ZSTR_LEN(str2), case_insensitive)); - - zend_tmp_string_release(tmp_str1); - zend_tmp_string_release(tmp_str2); - return SUCCESS; -} -/* }}} */ - -PHPAPI int string_natural_case_compare_function(zval *result, zval *op1, zval *op2) /* {{{ */ -{ - return string_natural_compare_function_ex(result, op1, op2, 1); -} -/* }}} */ - -PHPAPI int string_natural_compare_function(zval *result, zval *op1, zval *op2) /* {{{ */ -{ - return string_natural_compare_function_ex(result, op1, op2, 0); -} -/* }}} */ - /* {{{ Returns the result of string comparison using 'natural' algorithm */ PHP_FUNCTION(strnatcmp) {