diff options
Diffstat (limited to 'ext')
40 files changed, 290 insertions, 267 deletions
diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c index 7d478d682f..d433770112 100644 --- a/ext/ereg/ereg.c +++ b/ext/ereg/ereg.c @@ -144,7 +144,7 @@ static int _php_regcomp(regex_t *preg, const char *pattern, int cflags) if (zend_hash_num_elements(&EREG(ht_rc)) >= EREG_CACHE_SIZE) { /* easier than dealing with overflow as it happens */ - if (EREG(lru_counter) >= (1 << 31) || zend_hash_sort(&EREG(ht_rc), zend_qsort, ereg_lru_cmp, 0) == FAILURE) { + if (EREG(lru_counter) >= (1 << 31) || zend_hash_sort(&EREG(ht_rc), (compare_func_t)ereg_lru_cmp, 0) == FAILURE) { zend_hash_clean(&EREG(ht_rc)); EREG(lru_counter) = 0; } else { diff --git a/ext/intl/collator/collator_sort.c b/ext/intl/collator/collator_sort.c index 46571e5ead..add109889d 100644 --- a/ext/intl/collator/collator_sort.c +++ b/ext/intl/collator/collator_sort.c @@ -321,7 +321,7 @@ static void collator_sort_internal( int renumber, INTERNAL_FUNCTION_PARAMETERS ) ZVAL_COPY_VALUE(&INTL_G( current_collator ), object); /* Sort specified array. */ - zend_hash_sort( hash, zend_qsort, collator_compare_func, renumber ); + zend_hash_sort(hash, collator_compare_func, renumber); /* Restore saved collator. */ ZVAL_COPY_VALUE(&INTL_G( current_collator ), &saved_collator); @@ -345,6 +345,15 @@ PHP_FUNCTION( collator_sort ) } /* }}} */ +static collator_sortkey_swap(collator_sort_key_index_t *p, collator_sort_key_index_t *q) /* {{{ */ +{ + collator_sort_key_index_t t; + t = *p; + *p = *q; + *q = t; +} +/* }}} */ + /* {{{ proto bool Collator::sortWithSortKeys( Collator $coll, array(string) $arr ) * Equivalent to standard PHP sort using Collator. * Uses ICU ucol_getSortKey for performance. }}} */ @@ -496,7 +505,8 @@ PHP_FUNCTION( collator_sort_with_sort_keys ) sortKeyIndxBuf[j].key = sortKeyBuf + (ptrdiff_t)sortKeyIndxBuf[j].key; /* sort it */ - zend_qsort( sortKeyIndxBuf, sortKeyCount, sortKeyIndxSize, collator_cmp_sort_keys ); + zend_sort( sortKeyIndxBuf, sortKeyCount, + sortKeyIndxSize, collator_cmp_sort_keys, (swap_func_t)collator_sortkey_swap); zval_ptr_dtor( array ); /* for resulting hash we'll assign new hash keys rather then reordering */ @@ -532,7 +542,7 @@ PHP_FUNCTION( collator_asort ) /* {{{ proto bool Collator::getSortKey( Collator $coll, string $str ) * Get a sort key for a string from a Collator. }}} */ /* {{{ proto bool collator_get_sort_key( Collator $coll, string $str ) - * Get a sort key for a string from a Collator. }}} */ + * Get a sort key for a string from a Collator. */ PHP_FUNCTION( collator_get_sort_key ) { char* str = NULL; diff --git a/ext/phar/dirstream.c b/ext/phar/dirstream.c index 9a8c5bfc31..3de030f89e 100644 --- a/ext/phar/dirstream.c +++ b/ext/phar/dirstream.c @@ -285,7 +285,7 @@ PHAR_ADD_ENTRY: if (FAILURE != zend_hash_has_more_elements(data)) { efree(dir); - if (zend_hash_sort(data, zend_qsort, phar_compare_dir_name, 0) == FAILURE) { + if (zend_hash_sort(data, phar_compare_dir_name, 0) == FAILURE) { FREE_HASHTABLE(data); return NULL; } diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index fed80029f6..81c5d36e4a 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -33,7 +33,7 @@ #include "zend_hash.h" #include "zend_interfaces.h" #include "zend_operators.h" -#include "zend_qsort.h" +#include "zend_sort.h" #include "zend_vm.h" #include "zend_smart_str.h" #include "main/php_streams.h" diff --git a/ext/standard/array.c b/ext/standard/array.c index f31015b1e2..6e8b8e5624 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -187,7 +187,7 @@ static int php_array_key_compare(const void *a, const void *b) /* {{{ */ ZVAL_STR(&first, f->key); } - if (s->key == 0) { + if (s->key == NULL) { ZVAL_LONG(&second, s->h); } else { ZVAL_STR(&second, s->key); @@ -226,7 +226,7 @@ PHP_FUNCTION(krsort) php_set_compare_func(sort_type); - if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_reverse_key_compare, 0) == FAILURE) { + if (zend_hash_sort(Z_ARRVAL_P(array), php_array_reverse_key_compare, 0) == FAILURE) { RETURN_FALSE; } RETURN_TRUE; @@ -254,7 +254,7 @@ PHP_FUNCTION(ksort) php_set_compare_func(sort_type); - if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_key_compare, 0) == FAILURE) { + if (zend_hash_sort(Z_ARRVAL_P(array), php_array_key_compare, 0) == FAILURE) { RETURN_FALSE; } RETURN_TRUE; @@ -438,11 +438,11 @@ static void php_natsort(INTERNAL_FUNCTION_PARAMETERS, int fold_case) /* {{{ */ } if (fold_case) { - if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_natural_case_compare, 0) == FAILURE) { + if (zend_hash_sort(Z_ARRVAL_P(array), php_array_natural_case_compare, 0) == FAILURE) { return; } } else { - if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_natural_compare, 0) == FAILURE) { + if (zend_hash_sort(Z_ARRVAL_P(array), php_array_natural_compare, 0) == FAILURE) { return; } } @@ -480,7 +480,7 @@ PHP_FUNCTION(asort) php_set_compare_func(sort_type); - if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_data_compare, 0) == FAILURE) { + if (zend_hash_sort(Z_ARRVAL_P(array), php_array_data_compare, 0) == FAILURE) { RETURN_FALSE; } RETURN_TRUE; @@ -500,7 +500,7 @@ PHP_FUNCTION(arsort) php_set_compare_func(sort_type); - if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_reverse_data_compare, 0) == FAILURE) { + if (zend_hash_sort(Z_ARRVAL_P(array), php_array_reverse_data_compare, 0) == FAILURE) { RETURN_FALSE; } RETURN_TRUE; @@ -520,7 +520,7 @@ PHP_FUNCTION(sort) php_set_compare_func(sort_type); - if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_data_compare, 1) == FAILURE) { + if (zend_hash_sort(Z_ARRVAL_P(array), php_array_data_compare, 1) == FAILURE) { RETURN_FALSE; } RETURN_TRUE; @@ -540,7 +540,7 @@ PHP_FUNCTION(rsort) php_set_compare_func(sort_type); - if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_reverse_data_compare, 1) == FAILURE) { + if (zend_hash_sort(Z_ARRVAL_P(array), php_array_reverse_data_compare, 1) == FAILURE) { RETURN_FALSE; } RETURN_TRUE; @@ -633,7 +633,7 @@ PHP_FUNCTION(usort) refcount = Z_REFCOUNT_P(array); arr = Z_COUNTED_P(array); - if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_user_compare, 1) == FAILURE) { + if (zend_hash_sort(Z_ARRVAL_P(array), php_array_user_compare, 1) == FAILURE) { RETVAL_FALSE; } else { if (refcount > Z_REFCOUNT_P(array)) { @@ -678,7 +678,7 @@ PHP_FUNCTION(uasort) refcount = Z_REFCOUNT_P(array); arr = Z_COUNTED_P(array); - if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_user_compare, 0) == FAILURE) { + if (zend_hash_sort(Z_ARRVAL_P(array), php_array_user_compare, 0) == FAILURE) { RETVAL_FALSE; } else { if (refcount > Z_REFCOUNT_P(array)) { @@ -766,7 +766,7 @@ PHP_FUNCTION(uksort) refcount = Z_REFCOUNT_P(array); arr = Z_COUNTED_P(array); - if (zend_hash_sort(Z_ARRVAL_P(array), zend_qsort, php_array_user_key_compare, 0) == FAILURE) { + if (zend_hash_sort(Z_ARRVAL_P(array), php_array_user_key_compare, 0) == FAILURE) { RETVAL_FALSE; } else { if (refcount > Z_REFCOUNT_P(array)) { @@ -3117,6 +3117,22 @@ PHP_FUNCTION(array_change_key_case) } /* }}} */ +struct bucketindex { + Bucket b; + unsigned int i; +}; + +static void array_bucketindex_swap(void *p, void *q) /* {{{ */ +{ + struct bucketindex *f = (struct bucketindex *)p; + struct bucketindex *g = (struct bucketindex *)q; + struct bucketindex t; + t = *f; + *f = *g; + *g = t; +} +/* }}} */ + /* {{{ proto array array_unique(array input [, int sort_flags]) Removes duplicate values from array */ PHP_FUNCTION(array_unique) @@ -3124,10 +3140,6 @@ PHP_FUNCTION(array_unique) zval *array; uint idx; Bucket *p; - struct bucketindex { - Bucket b; - unsigned int i; - }; struct bucketindex *arTmp, *cmpdata, *lastkept; unsigned int i; zend_long sort_type = PHP_SORT_STRING; @@ -3160,8 +3172,8 @@ PHP_FUNCTION(array_unique) i++; } ZVAL_UNDEF(&arTmp[i].b.val); - zend_qsort((void *) arTmp, i, sizeof(struct bucketindex), php_array_data_compare); - + zend_sort((void *) arTmp, i, sizeof(struct bucketindex), + php_array_data_compare, (swap_func_t)array_bucketindex_swap); /* go through the sorted array and delete duplicates from the copy */ lastkept = arTmp; for (cmpdata = arTmp + 1; Z_TYPE(cmpdata->b.val) != IS_UNDEF; cmpdata++) { @@ -3484,9 +3496,11 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int ZVAL_UNDEF(&list->val); if (hash->nNumOfElements > 1) { if (behavior == INTERSECT_NORMAL) { - zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), intersect_data_compare_func); + zend_sort((void *) lists[i], hash->nNumOfElements, + sizeof(Bucket), intersect_data_compare_func, (swap_func_t)zend_hash_bucket_swap); } else if (behavior & INTERSECT_ASSOC) { /* triggered also when INTERSECT_KEY */ - zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), intersect_key_compare_func); + zend_sort((void *) lists[i], hash->nNumOfElements, + sizeof(Bucket), intersect_key_compare_func, (swap_func_t)zend_hash_bucket_swap); } } } @@ -3498,9 +3512,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int /* go through the lists and look for common values */ while (Z_TYPE(ptrs[0]->val) != IS_UNDEF) { if ((behavior & INTERSECT_ASSOC) /* triggered also when INTERSECT_KEY */ - && - key_compare_type == INTERSECT_COMP_KEY_USER) { - + && key_compare_type == INTERSECT_COMP_KEY_USER) { BG(user_compare_fci) = *fci_key; BG(user_compare_fci_cache) = *fci_key_cache; } @@ -3904,9 +3916,11 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ ZVAL_UNDEF(&list->val); if (hash->nNumOfElements > 1) { if (behavior == DIFF_NORMAL) { - zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), diff_data_compare_func); + zend_sort((void *) lists[i], hash->nNumOfElements, + sizeof(Bucket), diff_data_compare_func, (swap_func_t)zend_hash_bucket_swap); } else if (behavior & DIFF_ASSOC) { /* triggered also when DIFF_KEY */ - zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket), diff_key_compare_func); + zend_sort((void *) lists[i], hash->nNumOfElements, + sizeof(Bucket), diff_key_compare_func, (swap_func_t)zend_hash_bucket_swap); } } } @@ -4186,6 +4200,17 @@ PHPAPI int php_multisort_compare(const void *a, const void *b) /* {{{ */ efree(arrays); \ RETURN_FALSE; +static void array_bucket_p_sawp(void *p, void *q) /* {{{ */ { + Bucket *t; + Bucket **f = (Bucket **)p; + Bucket **g = (Bucket **)q; + + t = *f; + *f = *g; + *g = t; +} +/* }}} */ + /* {{{ proto bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]], ...]) Sort multiple arrays at once similar to how ORDER BY clause works in SQL */ PHP_FUNCTION(array_multisort) @@ -4330,7 +4355,7 @@ PHP_FUNCTION(array_multisort) } /* Do the actual sort magic - bada-bim, bada-boom. */ - zend_qsort(indirect, array_size, sizeof(Bucket *), php_multisort_compare); + zend_qsort(indirect, array_size, sizeof(Bucket *), php_multisort_compare, (swap_func_t)array_bucket_p_sawp); /* Restructure the arrays based on sorted indirect - this is mostly taken from zend_hash_sort() function. */ HANDLE_BLOCK_INTERRUPTIONS(); diff --git a/ext/standard/info.c b/ext/standard/info.c index 8439e791e8..ba553cb9b3 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -862,7 +862,7 @@ PHPAPI void php_print_info(int flag) zend_hash_init(&sorted_registry, zend_hash_num_elements(&module_registry), NULL, NULL, 1); zend_hash_copy(&sorted_registry, &module_registry, NULL); - zend_hash_sort(&sorted_registry, zend_qsort, module_name_cmp, 0); + zend_hash_sort(&sorted_registry, module_name_cmp, 0); zend_hash_apply(&sorted_registry, _display_module_info_func); diff --git a/ext/standard/string.c b/ext/standard/string.c index 0566542234..4b713c90d3 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -2981,7 +2981,7 @@ static void php_strtr_array(zval *return_value, char *str, size_t slen, HashTabl len = zend_hash_num_elements(&num_hash); if ((maxlen - (minlen - 1) - len > 0) && /* smart algorithm, sort key lengths first */ - zend_hash_sort(&num_hash, zend_qsort, php_strtr_key_compare, 0) == SUCCESS) { + zend_hash_sort(&num_hash, php_strtr_key_compare, 0) == SUCCESS) { pos = 0; while (pos <= slen - minlen) { diff --git a/ext/standard/tests/array/002.phpt b/ext/standard/tests/array/002.phpt index 469e862675..204863f0e9 100644 --- a/ext/standard/tests/array/002.phpt +++ b/ext/standard/tests/array/002.phpt @@ -115,30 +115,32 @@ array(8) { [1]=> string(6) "orange" } - [0]=> - string(3) "PHP" - [17]=> - string(27) "PHP: Hypertext Preprocessor" + [1000]=> + string(4) "test" [1001]=> string(6) "monkey" [5]=> string(4) "Test" - [1000]=> - string(4) "test" + [17]=> + string(27) "PHP: Hypertext Preprocessor" + [0]=> + string(3) "PHP" [16777216]=> float(-0.33333333333333) } Using SORT_STRING -Notice: Array to string conversion in %s002.php on line %d +Notice: Array to string conversion in %s002.php on line 16 + +Notice: Array to string conversion in %s002.php on line 16 -Notice: Array to string conversion in %s002.php on line %d +Notice: Array to string conversion in %s002.php on line 16 -Notice: Array to string conversion in %s002.php on line %d +Notice: Array to string conversion in %s002.php on line 16 -Notice: Array to string conversion in %s002.php on line %d +Notice: Array to string conversion in %s002.php on line 16 -Notice: Array to string conversion in %s002.php on line %d +Notice: Array to string conversion in %s002.php on line 16 array(8) { [1000]=> string(4) "test" @@ -216,16 +218,16 @@ Using SORT_NUMERIC: array(8) { [16777216]=> float(-0.33333333333333) + [0]=> + string(3) "PHP" + [17]=> + string(27) "PHP: Hypertext Preprocessor" + [5]=> + string(4) "Test" [1001]=> string(6) "monkey" [1000]=> string(4) "test" - [5]=> - string(4) "Test" - [17]=> - string(27) "PHP: Hypertext Preprocessor" - [0]=> - string(3) "PHP" [-1000]=> array(2) { [0]=> @@ -238,15 +240,15 @@ array(8) { } Using SORT_STRING -Notice: Array to string conversion in %s002.php on line %d +Notice: Array to string conversion in %s002.php on line 16 -Notice: Array to string conversion in %s002.php on line %d +Notice: Array to string conversion in %s002.php on line 16 -Notice: Array to string conversion in %s002.php on line %d +Notice: Array to string conversion in %s002.php on line 16 -Notice: Array to string conversion in %s002.php on line %d +Notice: Array to string conversion in %s002.php on line 16 -Notice: Array to string conversion in %s002.php on line %d +Notice: Array to string conversion in %s002.php on line 16 array(8) { [16777216]=> float(-0.33333333333333) @@ -284,10 +286,10 @@ array(8) { string(27) "PHP: Hypertext Preprocessor" [5]=> string(4) "Test" - ["test"]=> - int(27) [0]=> string(3) "PHP" + ["test"]=> + int(27) [-1000]=> array(2) { [0]=> @@ -332,10 +334,10 @@ array(8) { string(27) "PHP: Hypertext Preprocessor" [5]=> string(4) "Test" - ["test"]=> - int(27) [0]=> string(3) "PHP" + ["test"]=> + int(27) [-1000]=> array(2) { [0]=> @@ -403,10 +405,10 @@ array(8) { [1]=> string(6) "orange" } - ["test"]=> - int(27) [0]=> string(3) "PHP" + ["test"]=> + int(27) [5]=> string(4) "Test" [17]=> @@ -528,29 +530,31 @@ array(8) { string(6) "orange" } [2]=> - string(3) "PHP" + string(4) "test" [3]=> - string(27) "PHP: Hypertext Preprocessor" - [4]=> string(6) "monkey" - [5]=> + [4]=> string(4) "Test" + [5]=> + string(27) "PHP: Hypertext Preprocessor" [6]=> - string(4) "test" + string(3) "PHP" [7]=> float(-0.33333333333333) } Using SORT_STRING -Notice: Array to string conversion in %s002.php on line %d +Notice: Array to string conversion in %s002.php on line 16 + +Notice: Array to string conversion in %s002.php on line 16 -Notice: Array to string conversion in %s002.php on line %d +Notice: Array to string conversion in %s002.php on line 16 -Notice: Array to string conversion in %s002.php on line %d +Notice: Array to string conversion in %s002.php on line 16 -Notice: Array to string conversion in %s002.php on line %d +Notice: Array to string conversion in %s002.php on line 16 -Notice: Array to string conversion in %s002.php on line %d +Notice: Array to string conversion in %s002.php on line 16 array(8) { [0]=> string(4) "test" @@ -629,15 +633,15 @@ array(8) { [0]=> float(-0.33333333333333) [1]=> - string(6) "monkey" + string(3) "PHP" [2]=> - string(4) "test" + string(27) "PHP: Hypertext Preprocessor" [3]=> string(4) "Test" [4]=> - string(27) "PHP: Hypertext Preprocessor" + string(6) "monkey" [5]=> - string(3) "PHP" + string(4) "test" [6]=> array(2) { [0]=> @@ -650,15 +654,15 @@ array(8) { } Using SORT_STRING -Notice: Array to string conversion in %s002.php on line %d +Notice: Array to string conversion in %s002.php on line 16 -Notice: Array to string conversion in %s002.php on line %d +Notice: Array to string conversion in %s002.php on line 16 -Notice: Array to string conversion in %s002.php on line %d +Notice: Array to string conversion in %s002.php on line 16 -Notice: Array to string conversion in %s002.php on line %d +Notice: Array to string conversion in %s002.php on line 16 -Notice: Array to string conversion in %s002.php on line %d +Notice: Array to string conversion in %s002.php on line 16 array(8) { [0]=> float(-0.33333333333333) diff --git a/ext/standard/tests/array/array_intersect_variation9.phpt b/ext/standard/tests/array/array_intersect_variation9.phpt index fda63dd628..0dba1af6d3 100644 --- a/ext/standard/tests/array/array_intersect_variation9.phpt +++ b/ext/standard/tests/array/array_intersect_variation9.phpt @@ -92,10 +92,6 @@ Notice: Array to string conversion in %sarray_intersect_variation9.php on line % Notice: Array to string conversion in %sarray_intersect_variation9.php on line %d Notice: Array to string conversion in %sarray_intersect_variation9.php on line %d - -Notice: Array to string conversion in %sarray_intersect_variation9.php on line %d - -Notice: Array to string conversion in %sarray_intersect_variation9.php on line %d array(4) { [0]=> array(4) { @@ -187,14 +183,6 @@ Notice: Array to string conversion in %sarray_intersect_variation9.php on line % Notice: Array to string conversion in %sarray_intersect_variation9.php on line %d Notice: Array to string conversion in %sarray_intersect_variation9.php on line %d - -Notice: Array to string conversion in %sarray_intersect_variation9.php on line %d - -Notice: Array to string conversion in %sarray_intersect_variation9.php on line %d - -Notice: Array to string conversion in %sarray_intersect_variation9.php on line %d - -Notice: Array to string conversion in %sarray_intersect_variation9.php on line %d array(4) { [0]=> array(4) { diff --git a/ext/standard/tests/array/array_unique_variation8.phpt b/ext/standard/tests/array/array_unique_variation8.phpt index ee34deeecc..3b4eac9f75 100644 --- a/ext/standard/tests/array/array_unique_variation8.phpt +++ b/ext/standard/tests/array/array_unique_variation8.phpt @@ -52,10 +52,6 @@ Notice: Array to string conversion in %sarray_unique_variation8.php on line %d Notice: Array to string conversion in %sarray_unique_variation8.php on line %d Notice: Array to string conversion in %sarray_unique_variation8.php on line %d - -Notice: Array to string conversion in %sarray_unique_variation8.php on line %d - -Notice: Array to string conversion in %sarray_unique_variation8.php on line %d array(1) { [0]=> array(4) { diff --git a/ext/standard/tests/array/array_user_key_compare.phpt b/ext/standard/tests/array/array_user_key_compare.phpt index 7f82f71cab..933e6d679a 100644 --- a/ext/standard/tests/array/array_user_key_compare.phpt +++ b/ext/standard/tests/array/array_user_key_compare.phpt @@ -16,4 +16,4 @@ var_dump($a); ?> --EXPECTF-- -string(1) "A" +string(1) "B" diff --git a/ext/standard/tests/array/arsort_variation11.phpt b/ext/standard/tests/array/arsort_variation11.phpt Binary files differindex e8bfd772ee..0ab1c8abf5 100644 --- a/ext/standard/tests/array/arsort_variation11.phpt +++ b/ext/standard/tests/array/arsort_variation11.phpt diff --git a/ext/standard/tests/array/arsort_variation3.phpt b/ext/standard/tests/array/arsort_variation3.phpt index 609155ca73..5b2de4b20b 100644 --- a/ext/standard/tests/array/arsort_variation3.phpt +++ b/ext/standard/tests/array/arsort_variation3.phpt @@ -273,54 +273,54 @@ array(11) { bool(true) array(7) { [2]=> - %s(2147483648) + int(2147483648) [1]=> int(2147483647) - [6]=> - int(0) [5]=> int(0) + [6]=> + int(0) [3]=> int(-2147483647) [4]=> - %s(-2147483648) + int(-2147483648) [7]=> - %s(-2147483649) + int(-2147483649) } - Sort_flag = SORT_REGULAR - bool(true) array(7) { [2]=> - %s(2147483648) + int(2147483648) [1]=> int(2147483647) - [6]=> - int(0) [5]=> int(0) + [6]=> + int(0) [3]=> int(-2147483647) [4]=> - %s(-2147483648) + int(-2147483648) [7]=> - %s(-2147483649) + int(-2147483649) } - Sort_flag = SORT_NUMERIC - bool(true) array(7) { [2]=> - %s(2147483648) + int(2147483648) [1]=> int(2147483647) - [6]=> - int(0) [5]=> int(0) + [6]=> + int(0) [3]=> int(-2147483647) [4]=> - %s(-2147483648) + int(-2147483648) [7]=> - %s(-2147483649) + int(-2147483649) } -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/array/arsort_variation7.phpt b/ext/standard/tests/array/arsort_variation7.phpt index 97195b709f..dc661b572e 100644 --- a/ext/standard/tests/array/arsort_variation7.phpt +++ b/ext/standard/tests/array/arsort_variation7.phpt @@ -47,52 +47,52 @@ echo "Done\n"; -- Testing arsort() by supplying bool value array, 'flag' value is defualt -- bool(true) array(4) { - [3]=> - bool(true) [1]=> bool(true) - [4]=> - bool(false) + [3]=> + bool(true) [2]=> bool(false) + [4]=> + bool(false) } -- Testing arsort() by supplying bool value array, 'flag' value is SORT_REGULAR -- bool(true) array(4) { - [3]=> - bool(true) [1]=> bool(true) - [4]=> - bool(false) + [3]=> + bool(true) [2]=> bool(false) + [4]=> + bool(false) } -- Testing arsort() by supplying bool value array, 'flag' value is SORT_NUMERIC -- bool(true) array(4) { - [3]=> - bool(true) [1]=> bool(true) - [4]=> - bool(false) + [3]=> + bool(true) [2]=> bool(false) + [4]=> + bool(false) } -- Testing arsort() by supplying bool value array, 'flag' value is SORT_STRING -- bool(true) array(4) { - [3]=> - bool(true) [1]=> bool(true) - [4]=> - bool(false) + [3]=> + bool(true) [2]=> bool(false) + [4]=> + bool(false) } -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/array/arsort_variation9.phpt b/ext/standard/tests/array/arsort_variation9.phpt index a034db5d9a..1e319e783c 100644 --- a/ext/standard/tests/array/arsort_variation9.phpt +++ b/ext/standard/tests/array/arsort_variation9.phpt @@ -170,13 +170,13 @@ array(6) { int(19) [3]=> int(13) - [4]=> - int(1) - [8]=> + [0]=> int(1) [1]=> int(1) - [0]=> + [8]=> + int(1) + [4]=> int(1) } - Sort_flag = SORT_REGULAR - @@ -186,13 +186,13 @@ array(6) { int(19) [3]=> int(13) - [4]=> - int(1) - [8]=> + [0]=> int(1) [1]=> int(1) - [0]=> + [8]=> + int(1) + [4]=> int(1) } @@ -255,4 +255,4 @@ array(4) { ["a"]=> int(1) } -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/array/asort_variation11.phpt b/ext/standard/tests/array/asort_variation11.phpt Binary files differindex fca91a968f..013865f2c2 100644 --- a/ext/standard/tests/array/asort_variation11.phpt +++ b/ext/standard/tests/array/asort_variation11.phpt diff --git a/ext/standard/tests/array/asort_variation3.phpt b/ext/standard/tests/array/asort_variation3.phpt index 25f40d32a3..563a20e4b0 100644 --- a/ext/standard/tests/array/asort_variation3.phpt +++ b/ext/standard/tests/array/asort_variation3.phpt @@ -273,54 +273,54 @@ array(11) { bool(true) array(7) { [7]=> - %s(-2147483649) + int(-2147483649) [4]=> - %s(-2147483648) + int(-2147483648) [3]=> int(-2147483647) - [6]=> - int(0) [5]=> int(0) + [6]=> + int(0) [1]=> int(2147483647) [2]=> - %s(2147483648) + int(2147483648) } - Sort_flag = SORT_REGULAR - bool(true) array(7) { [7]=> - %s(-2147483649) + int(-2147483649) [4]=> - %s(-2147483648) + int(-2147483648) [3]=> int(-2147483647) - [6]=> - int(0) [5]=> int(0) + [6]=> + int(0) [1]=> int(2147483647) [2]=> - %s(2147483648) + int(2147483648) } - Sort_flag = SORT_NUMERIC - bool(true) array(7) { [7]=> - %s(-2147483649) + int(-2147483649) [4]=> - %s(-2147483648) + int(-2147483648) [3]=> int(-2147483647) - [6]=> - int(0) [5]=> int(0) + [6]=> + int(0) [1]=> int(2147483647) [2]=> - %s(2147483648) + int(2147483648) } Done diff --git a/ext/standard/tests/array/asort_variation7.phpt b/ext/standard/tests/array/asort_variation7.phpt index 6050b86536..c078eb042c 100644 --- a/ext/standard/tests/array/asort_variation7.phpt +++ b/ext/standard/tests/array/asort_variation7.phpt @@ -47,10 +47,10 @@ echo "Done\n"; -- Testing asort() by supplying bool value array, 'flag' value is defualt -- bool(true) array(4) { - [4]=> - bool(false) [2]=> bool(false) + [4]=> + bool(false) [1]=> bool(true) [3]=> @@ -60,10 +60,10 @@ array(4) { -- Testing asort() by supplying bool value array, 'flag' value is SORT_REGULAR -- bool(true) array(4) { - [4]=> - bool(false) [2]=> bool(false) + [4]=> + bool(false) [1]=> bool(true) [3]=> @@ -73,10 +73,10 @@ array(4) { -- Testing asort() by supplying bool value array, 'flag' value is SORT_NUMERIC -- bool(true) array(4) { - [4]=> - bool(false) [2]=> bool(false) + [4]=> + bool(false) [1]=> bool(true) [3]=> @@ -86,10 +86,10 @@ array(4) { -- Testing asort() by supplying bool value array, 'flag' value is SORT_STRING -- bool(true) array(4) { - [4]=> - bool(false) [2]=> bool(false) + [4]=> + bool(false) [1]=> bool(true) [3]=> diff --git a/ext/standard/tests/array/asort_variation9.phpt b/ext/standard/tests/array/asort_variation9.phpt index d79b6fc4af..85ef679daa 100644 --- a/ext/standard/tests/array/asort_variation9.phpt +++ b/ext/standard/tests/array/asort_variation9.phpt @@ -166,13 +166,13 @@ array(3) { - With default sort_flag - bool(true) array(6) { - [4]=> - int(1) [0]=> int(1) + [1]=> + int(1) [8]=> int(1) - [1]=> + [4]=> int(1) [3]=> int(13) @@ -182,13 +182,13 @@ array(6) { - Sort_flag = SORT_REGULAR - bool(true) array(6) { - [4]=> - int(1) [0]=> int(1) + [1]=> + int(1) [8]=> int(1) - [1]=> + [4]=> int(1) [3]=> int(13) diff --git a/ext/standard/tests/array/bug36975.phpt b/ext/standard/tests/array/bug36975.phpt index f37c933e3f..7912fffca4 100644 --- a/ext/standard/tests/array/bug36975.phpt +++ b/ext/standard/tests/array/bug36975.phpt @@ -31,13 +31,13 @@ array(6) { string(2) "aa" [1]=> string(2) "aa" - [3]=> - string(2) "bb" [2]=> string(2) "bb" - [5]=> + [3]=> + string(2) "bb" + [4]=> string(2) "cc" - [6]=> + [5]=> string(2) "cc" } Array @@ -47,16 +47,16 @@ Array [3] => bar ) array(6) { - [4]=> + [0]=> int(0) - [3]=> + [1]=> int(0) [2]=> int(0) - [1]=> + [3]=> int(0) - [5]=> + [4]=> string(3) "foo" - [6]=> + [5]=> string(3) "bar" } diff --git a/ext/standard/tests/array/bug50006.phpt b/ext/standard/tests/array/bug50006.phpt index f03a002629..948866361a 100644 --- a/ext/standard/tests/array/bug50006.phpt +++ b/ext/standard/tests/array/bug50006.phpt @@ -24,6 +24,6 @@ function magic_sort_cmp($a, $b) { Array ( [foo] => 0 - [bar-bazbazbaz-] => 0 [bar-bazbazbaz.] => 0 + [bar-bazbazbaz-] => 0 ) diff --git a/ext/standard/tests/array/bug50006_1.phpt b/ext/standard/tests/array/bug50006_1.phpt index fbb7ddd594..3df67f3a4b 100644 --- a/ext/standard/tests/array/bug50006_1.phpt +++ b/ext/standard/tests/array/bug50006_1.phpt @@ -24,6 +24,6 @@ function magic_sort_cmp($a, $b) { Array ( [0] => foo - [1] => bar-bazbazbaz- - [2] => bar-bazbazbaz. + [1] => bar-bazbazbaz. + [2] => bar-bazbazbaz- ) diff --git a/ext/standard/tests/array/bug50006_2.phpt b/ext/standard/tests/array/bug50006_2.phpt index 19c0d14252..48bb751703 100644 --- a/ext/standard/tests/array/bug50006_2.phpt +++ b/ext/standard/tests/array/bug50006_2.phpt @@ -24,6 +24,6 @@ function magic_sort_cmp($a, $b) { Array ( [2] => foo - [1] => bar-bazbazbaz- [0] => bar-bazbazbaz. + [1] => bar-bazbazbaz- ) diff --git a/ext/standard/tests/array/krsort_variation8.phpt b/ext/standard/tests/array/krsort_variation8.phpt Binary files differindex 20276ade6c..f5a40cbeed 100644 --- a/ext/standard/tests/array/krsort_variation8.phpt +++ b/ext/standard/tests/array/krsort_variation8.phpt diff --git a/ext/standard/tests/array/krsort_variation9.phpt b/ext/standard/tests/array/krsort_variation9.phpt index d7d8343b08..1b8ae5dd36 100644 --- a/ext/standard/tests/array/krsort_variation9.phpt +++ b/ext/standard/tests/array/krsort_variation9.phpt @@ -87,22 +87,22 @@ array(5) { - With defualt sort flag - bool(true) array(3) { - ["c"]=> - string(5) "apple" - [0]=> - string(6) "banana" ["a"]=> string(6) "orange" + [0]=> + string(6) "banana" + ["c"]=> + string(5) "apple" } - Sort flag = SORT_REGULAR - bool(true) array(3) { - ["c"]=> - string(5) "apple" - [0]=> - string(6) "banana" ["a"]=> string(6) "orange" + [0]=> + string(6) "banana" + ["c"]=> + string(5) "apple" } -- Iteration 3 -- diff --git a/ext/standard/tests/array/ksort_variation8.phpt b/ext/standard/tests/array/ksort_variation8.phpt Binary files differindex 787e71d616..f827883ce9 100644 --- a/ext/standard/tests/array/ksort_variation8.phpt +++ b/ext/standard/tests/array/ksort_variation8.phpt diff --git a/ext/standard/tests/array/ksort_variation9.phpt b/ext/standard/tests/array/ksort_variation9.phpt index ed406e20b2..8aa1e2f29d 100644 --- a/ext/standard/tests/array/ksort_variation9.phpt +++ b/ext/standard/tests/array/ksort_variation9.phpt @@ -86,22 +86,22 @@ array(5) { - With defualt sort flag - bool(true) array(3) { - ["c"]=> - string(5) "apple" - [0]=> - string(6) "banana" ["a"]=> string(6) "orange" + [0]=> + string(6) "banana" + ["c"]=> + string(5) "apple" } - Sort flag = SORT_REGULAR - bool(true) array(3) { - ["c"]=> - string(5) "apple" - [0]=> - string(6) "banana" ["a"]=> string(6) "orange" + [0]=> + string(6) "banana" + ["c"]=> + string(5) "apple" } -- Iteration 3 -- diff --git a/ext/standard/tests/array/natcasesort_basic.phpt b/ext/standard/tests/array/natcasesort_basic.phpt index cf6cc57288..2c173a6bec 100644 --- a/ext/standard/tests/array/natcasesort_basic.phpt +++ b/ext/standard/tests/array/natcasesort_basic.phpt @@ -43,10 +43,10 @@ array(5) { -- After Sorting: -- bool(true) array(5) { - [3]=> - string(3) "a01" [0]=> string(3) "A01" + [3]=> + string(3) "a01" [1]=> string(2) "a1" [4]=> @@ -54,4 +54,4 @@ array(5) { [2]=> string(3) "b10" } -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/array/natcasesort_variation2.phpt b/ext/standard/tests/array/natcasesort_variation2.phpt index 00edf94346..8a05c12f93 100644 --- a/ext/standard/tests/array/natcasesort_variation2.phpt +++ b/ext/standard/tests/array/natcasesort_variation2.phpt @@ -152,19 +152,19 @@ array(5) { -- Iteration 3 -- bool(true) array(2) { - [1]=> - NULL [0]=> NULL + [1]=> + NULL } -- Iteration 4 -- bool(true) array(4) { - [3]=> - bool(false) [1]=> bool(false) + [3]=> + bool(false) [0]=> bool(true) [2]=> @@ -174,10 +174,10 @@ array(4) { -- Iteration 5 -- bool(true) array(2) { - [1]=> - string(0) "" [0]=> string(0) "" + [1]=> + string(0) "" } -- Iteration 6 -- @@ -190,10 +190,10 @@ bool(true) array(3) { [2]=> string(11) "hello world" - [1]=> - string(6) "string" [0]=> string(6) "string" + [1]=> + string(6) "string" } -- Iteration 8 -- @@ -224,4 +224,4 @@ array(1) { [0]=> resource(%d) of type (stream) } -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/array/natcasesort_variation4.phpt b/ext/standard/tests/array/natcasesort_variation4.phpt index c7f99e1f6d..d7dee1e8e7 100644 --- a/ext/standard/tests/array/natcasesort_variation4.phpt +++ b/ext/standard/tests/array/natcasesort_variation4.phpt @@ -41,15 +41,15 @@ array(11) { NULL [1]=> NULL + [5]=> + string(1) "" [6]=> string(1) " " - [10]=> - string(1) "" [7]=> string(1) " " - [5]=> - string(1) "" + [10]=> + string(1) "" [4]=> string(1) "" [2]=> @@ -65,16 +65,16 @@ bool(true) array(12) { [3]=> string(5) "apple" - [11]=> - string(6) "BANANA" [2]=> string(6) "banana" + [11]=> + string(6) "BANANA" [0]=> string(5) "lemoN" - [10]=> - string(6) "oraNGe" [1]=> string(6) "Orange" + [10]=> + string(6) "oraNGe" [4]=> string(4) "Test" [6]=> diff --git a/ext/standard/tests/array/natcasesort_variation9.phpt b/ext/standard/tests/array/natcasesort_variation9.phpt Binary files differindex 98eec05a05..cc40378238 100644 --- a/ext/standard/tests/array/natcasesort_variation9.phpt +++ b/ext/standard/tests/array/natcasesort_variation9.phpt diff --git a/ext/standard/tests/array/rsort_variation11.phpt b/ext/standard/tests/array/rsort_variation11.phpt Binary files differindex 83bbf84df0..a2f0fdc3e4 100644 --- a/ext/standard/tests/array/rsort_variation11.phpt +++ b/ext/standard/tests/array/rsort_variation11.phpt diff --git a/ext/standard/tests/array/rsort_variation9.phpt b/ext/standard/tests/array/rsort_variation9.phpt index c08791df19..023d401314 100644 --- a/ext/standard/tests/array/rsort_variation9.phpt +++ b/ext/standard/tests/array/rsort_variation9.phpt @@ -108,15 +108,6 @@ array(3) { } [1]=> array(3) { - [0]=> - string(5) "first" - [5]=> - string(6) "second" - [6]=> - string(5) "third" - } - [2]=> - array(3) { ["a"]=> string(6) "orange" ["b"]=> @@ -124,6 +115,15 @@ array(3) { ["c"]=> string(5) "apple" } + [2]=> + array(3) { + [0]=> + string(5) "first" + [5]=> + string(6) "second" + [6]=> + string(5) "third" + } } -- Sort flag = SORT_REGULAR -- bool(true) @@ -145,15 +145,6 @@ array(3) { } [1]=> array(3) { - [0]=> - string(5) "first" - [5]=> - string(6) "second" - [6]=> - string(5) "third" - } - [2]=> - array(3) { ["a"]=> string(6) "orange" ["b"]=> @@ -161,6 +152,15 @@ array(3) { ["c"]=> string(5) "apple" } + [2]=> + array(3) { + [0]=> + string(5) "first" + [5]=> + string(6) "second" + [6]=> + string(5) "third" + } } -- Iteration 3 -- @@ -256,4 +256,4 @@ array(4) { [3]=> int(1) } -Done
\ No newline at end of file +Done diff --git a/ext/standard/tests/array/sort_variation11.phpt b/ext/standard/tests/array/sort_variation11.phpt Binary files differindex 56583d2089..bcab4bc998 100644 --- a/ext/standard/tests/array/sort_variation11.phpt +++ b/ext/standard/tests/array/sort_variation11.phpt diff --git a/ext/standard/tests/array/uasort_basic2.phpt b/ext/standard/tests/array/uasort_basic2.phpt index e1b4ac9b27..c5ca0f13c8 100644 --- a/ext/standard/tests/array/uasort_basic2.phpt +++ b/ext/standard/tests/array/uasort_basic2.phpt @@ -58,14 +58,14 @@ array(6) { int(1) [1]=> int(1) - [3]=> - int(2) [2]=> int(2) - [5]=> - int(3) + [3]=> + int(2) [4]=> int(3) + [5]=> + int(3) } -- Numeric array with decreasing values -- bool(true) @@ -74,22 +74,22 @@ array(6) { int(1) [5]=> int(1) - [3]=> - int(2) [2]=> int(2) - [1]=> - int(3) + [3]=> + int(2) [0]=> int(3) + [1]=> + int(3) } -- Numeric array with increasing and decreasing values -- bool(true) array(6) { - [5]=> - int(1) [0]=> int(1) + [5]=> + int(1) [1]=> int(2) [4]=> diff --git a/ext/standard/tests/array/uasort_object2.phpt b/ext/standard/tests/array/uasort_object2.phpt index 889db9886a..b6862b7588 100644 --- a/ext/standard/tests/array/uasort_object2.phpt +++ b/ext/standard/tests/array/uasort_object2.phpt @@ -123,32 +123,32 @@ echo "Done" -- Testing uasort() with StaticClass objects -- bool(true) array(4) { - [3]=> + [0]=> object(StaticClass)#%d (0) { } - [2]=> + [1]=> object(StaticClass)#%d (0) { } - [1]=> + [2]=> object(StaticClass)#%d (0) { } - [0]=> + [3]=> object(StaticClass)#%d (0) { } } -- Testing uasort() with EmptyClass objects -- bool(true) array(4) { - [3]=> + [0]=> object(EmptyClass)#%d (0) { } - [2]=> + [1]=> object(EmptyClass)#%d (0) { } - [1]=> + [2]=> object(EmptyClass)#%d (0) { } - [0]=> + [3]=> object(EmptyClass)#%d (0) { } } diff --git a/ext/standard/tests/array/uasort_variation11.phpt b/ext/standard/tests/array/uasort_variation11.phpt index 6d523eaede..50357dec5c 100644 --- a/ext/standard/tests/array/uasort_variation11.phpt +++ b/ext/standard/tests/array/uasort_variation11.phpt @@ -56,10 +56,10 @@ array(7) { int(1) [5]=> int(2) - ["z"]=> - int(3) [3]=> int(3) + ["z"]=> + int(3) ["o"]=> int(6) ["a"]=> diff --git a/ext/standard/tests/array/uasort_variation6.phpt b/ext/standard/tests/array/uasort_variation6.phpt index 48d9c03577..1c0b927764 100644 --- a/ext/standard/tests/array/uasort_variation6.phpt +++ b/ext/standard/tests/array/uasort_variation6.phpt @@ -62,15 +62,15 @@ array(8) { [0]=> int(-1) } - [6]=> + [3]=> array(1) { [0]=> - string(0) "" + int(0) } - [3]=> + [6]=> array(1) { [0]=> - int(0) + string(0) "" } [1]=> array(1) { diff --git a/ext/standard/tests/array/usort_variation6.phpt b/ext/standard/tests/array/usort_variation6.phpt index ab4b3d410d..3eb2eaa852 100644 --- a/ext/standard/tests/array/usort_variation6.phpt +++ b/ext/standard/tests/array/usort_variation6.phpt @@ -72,12 +72,12 @@ array(8) { [2]=> array(1) { [0]=> - string(0) "" + int(0) } [3]=> array(1) { [0]=> - int(0) + string(0) "" } [4]=> array(1) { diff --git a/ext/standard/tests/strings/get_html_translation_table_basic6.phpt b/ext/standard/tests/strings/get_html_translation_table_basic6.phpt index a4b2909f23..ad1c5986ab 100644 --- a/ext/standard/tests/strings/get_html_translation_table_basic6.phpt +++ b/ext/standard/tests/strings/get_html_translation_table_basic6.phpt @@ -239,11 +239,11 @@ array(5) { } -- with table = HTML_SPECIALCHARS, ENT_NOQUOTES -- array(3) { - [">"]=> - string(4) ">" - ["<"]=> - string(4) "<" ["&"]=> string(5) "&" + ["<"]=> + string(4) "<" + [">"]=> + string(4) ">" } Done |