mirror of
https://github.com/php/php-src.git
synced 2025-01-22 11:44:09 +08:00
Remove strnatcmp_ex() wrappers
These APIs always returned SUCCESS. Closes GH-8195
This commit is contained in:
parent
db0db2204f
commit
71a110fcaa
@ -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
|
||||
========================
|
||||
|
@ -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 <wchar.h>
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user