Skip to content

Commit 71a110f

Browse files
committed
Remove strnatcmp_ex() wrappers
These APIs always returned SUCCESS. Closes GH-8195
1 parent db0db22 commit 71a110f

File tree

3 files changed

+6
-30
lines changed

3 files changed

+6
-30
lines changed

UPGRADING.INTERNALS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ PHP 8.2 INTERNALS UPGRADE NOTES
2929
3. Module changes
3030
========================
3131

32+
a. ext/standard
33+
- The PHP APIs string_natural_compare_function_ex(),
34+
string_natural_case_compare_function(), and string_natural_compare_function()
35+
have been removed. They always returned SUCCESS and were a wrapper around
36+
strnatcmp_ex(). Use strnatcmp_ex() directly instead.
37+
3238
========================
3339
4. OpCode changes
3440
========================

ext/standard/php_string.h

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

62-
PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, bool case_insensitive);
63-
PHPAPI int string_natural_compare_function(zval *result, zval *op1, zval *op2);
64-
PHPAPI int string_natural_case_compare_function(zval *result, zval *op1, zval *op2);
65-
6662
#if defined(_REENTRANT)
6763
# ifdef PHP_WIN32
6864
# include <wchar.h>

ext/standard/string.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5406,32 +5406,6 @@ static void php_strnatcmp(INTERNAL_FUNCTION_PARAMETERS, int fold_case)
54065406
}
54075407
/* }}} */
54085408

5409-
PHPAPI int string_natural_compare_function_ex(zval *result, zval *op1, zval *op2, bool case_insensitive) /* {{{ */
5410-
{
5411-
zend_string *tmp_str1, *tmp_str2;
5412-
zend_string *str1 = zval_get_tmp_string(op1, &tmp_str1);
5413-
zend_string *str2 = zval_get_tmp_string(op2, &tmp_str2);
5414-
5415-
ZVAL_LONG(result, strnatcmp_ex(ZSTR_VAL(str1), ZSTR_LEN(str1), ZSTR_VAL(str2), ZSTR_LEN(str2), case_insensitive));
5416-
5417-
zend_tmp_string_release(tmp_str1);
5418-
zend_tmp_string_release(tmp_str2);
5419-
return SUCCESS;
5420-
}
5421-
/* }}} */
5422-
5423-
PHPAPI int string_natural_case_compare_function(zval *result, zval *op1, zval *op2) /* {{{ */
5424-
{
5425-
return string_natural_compare_function_ex(result, op1, op2, 1);
5426-
}
5427-
/* }}} */
5428-
5429-
PHPAPI int string_natural_compare_function(zval *result, zval *op1, zval *op2) /* {{{ */
5430-
{
5431-
return string_natural_compare_function_ex(result, op1, op2, 0);
5432-
}
5433-
/* }}} */
5434-
54355409
/* {{{ Returns the result of string comparison using 'natural' algorithm */
54365410
PHP_FUNCTION(strnatcmp)
54375411
{

0 commit comments

Comments
 (0)