diff options
| author | Derick Rethans <derick@php.net> | 2011-08-29 20:24:09 +0000 |
|---|---|---|
| committer | Derick Rethans <derick@php.net> | 2011-08-29 20:24:09 +0000 |
| commit | 56a87c280649f456e5062751b34ce881f957c69a (patch) | |
| tree | a92e0660d9c62568edf043bf49d05930ca25766b /Zend/zend_operators.c | |
| parent | b52256c5be9398e288f1503713bef959c8b7ae72 (diff) | |
| download | php-git-56a87c280649f456e5062751b34ce881f957c69a.tar.gz | |
- Zend engine part for bug #55158: Add SORT_NATURAL type to array_multisort
(patch by Arpad Ray).
Diffstat (limited to 'Zend/zend_operators.c')
| -rw-r--r-- | Zend/zend_operators.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 2f4905324c..35a545145c 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -1288,7 +1288,7 @@ ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{ } /* }}} */ -ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ +ZEND_API int string_compare_function_ex(zval *result, zval *op1, zval *op2, zend_bool case_insensitive TSRMLS_DC) /* {{{ */ { zval op1_copy, op2_copy; int use_copy1 = 0, use_copy2 = 0; @@ -1307,7 +1307,11 @@ ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_D op2 = &op2_copy; } - ZVAL_LONG(result, zend_binary_zval_strcmp(op1, op2)); + if (case_insensitive) { + ZVAL_LONG(result, zend_binary_zval_strcasecmp(op1, op2)); + } else { + ZVAL_LONG(result, zend_binary_zval_strcmp(op1, op2)); + } if (use_copy1) { zval_dtor(op1); @@ -1319,6 +1323,18 @@ ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_D } /* }}} */ +ZEND_API int string_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ +{ + return string_compare_function_ex(result, op1, op2, 0); +} +/* }}} */ + +ZEND_API int string_case_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ +{ + return string_compare_function_ex(result, op1, op2, 1); +} +/* }}} */ + #if HAVE_STRCOLL ZEND_API int string_locale_compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ */ { |
