Skip to content

Commit 623c4d0

Browse files
committed
Remove strnatcmp_ex() wrappers
1 parent fa60ff6 commit 623c4d0

File tree

3 files changed

+5
-30
lines changed

3 files changed

+5
-30
lines changed

UPGRADING.INTERNALS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ PHP 8.2 INTERNALS UPGRADE NOTES
3333
and php_string_tolower() have been removed.
3434
Use zend_str_toupper(), zend_string_toupper(), zend_str_tolower(),
3535
and zend_string_tolower() respectively instead.
36+
37+
- The PHP APIs string_natural_compare_function_ex(),
38+
string_natural_case_compare_function(), and string_natural_compare_function()
39+
have been removed. They always returned SUCCESS and were a wrapper around
40+
strnatcmp_ex(). Use strnatcmp_ex() directly instead.
3641
========================
3742
4. OpCode changes
3843
========================

ext/standard/php_string.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@ PHPAPI void php_explode(const zend_string *delim, zend_string *str, zval *return
5555
PHPAPI size_t php_strspn(const char *s1, const char *s2, const char *s1_end, const char *s2_end);
5656
PHPAPI size_t php_strcspn(const char *s1, const char *s2, const char *s1_end, const char *s2_end);
5757

58-
PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, bool case_insensitive);
59-
PHPAPI int string_natural_compare_function(zval *result, zval *op1, zval *op2);
60-
PHPAPI int string_natural_case_compare_function(zval *result, zval *op1, zval *op2);
61-
6258
#if defined(_REENTRANT)
6359
# ifdef PHP_WIN32
6460
# include <wchar.h>

ext/standard/string.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5376,32 +5376,6 @@ static void php_strnatcmp(INTERNAL_FUNCTION_PARAMETERS, int fold_case)
53765376
}
53775377
/* }}} */
53785378

5379-
PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, bool case_insensitive) /* {{{ */
5380-
{
5381-
zend_string *tmp_str1, *tmp_str2;
5382-
zend_string *str1 = zval_get_tmp_string(op1, &tmp_str1);
5383-
zend_string *str2 = zval_get_tmp_string(op2, &tmp_str2);
5384-
5385-
ZVAL_LONG(result, strnatcmp_ex(ZSTR_VAL(str1), ZSTR_LEN(str1), ZSTR_VAL(str2), ZSTR_LEN(str2), case_insensitive));
5386-
5387-
zend_tmp_string_release(tmp_str1);
5388-
zend_tmp_string_release(tmp_str2);
5389-
return SUCCESS;
5390-
}
5391-
/* }}} */
5392-
5393-
PHPAPI int string_natural_case_compare_function(zval *result, zval *op1, zval *op2) /* {{{ */
5394-
{
5395-
return string_natural_compare_function_ex(result, op1, op2, 1);
5396-
}
5397-
/* }}} */
5398-
5399-
PHPAPI int string_natural_compare_function(zval *result, zval *op1, zval *op2) /* {{{ */
5400-
{
5401-
return string_natural_compare_function_ex(result, op1, op2, 0);
5402-
}
5403-
/* }}} */
5404-
54055379
/* {{{ Returns the result of string comparison using 'natural' algorithm */
54065380
PHP_FUNCTION(strnatcmp)
54075381
{

0 commit comments

Comments
 (0)