summaryrefslogtreecommitdiff
path: root/ext/standard/php_array.h
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-03-04 11:52:55 +0100
committerNikita Popov <nikita.ppv@gmail.com>2020-06-25 10:49:34 +0200
commite12b9df05d238ec0f3cf47b28a49a4df1b1e3442 (patch)
tree90ed76d3d355bd0bf5832d49325de830c227e0cf /ext/standard/php_array.h
parentf9462fe6e47d4f729ca381d0ba44083138ece6b5 (diff)
downloadphp-git-e12b9df05d238ec0f3cf47b28a49a4df1b1e3442.tar.gz
Make sorting stable
Make user-exposed sorts stable, by storing the position of elements in the original array, and using those positions as a fallback comparison criterion. The base sort is still hybrid q/insert. The use of true/false comparison functions is deprecated (but still supported) and should be replaced by -1/0/1 comparison functions, driven by the <=> operator. RFC: https://wiki.php.net/rfc/stable_sorting Closes GH-5236.
Diffstat (limited to 'ext/standard/php_array.h')
-rw-r--r--ext/standard/php_array.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/standard/php_array.h b/ext/standard/php_array.h
index c513539dd2..a49e12488f 100644
--- a/ext/standard/php_array.h
+++ b/ext/standard/php_array.h
@@ -46,6 +46,7 @@ PHPAPI zend_long php_count_recursive(HashTable *ht);
ZEND_BEGIN_MODULE_GLOBALS(array)
bucket_compare_func_t *multisort_func;
+ zend_bool compare_deprecation_thrown;
ZEND_END_MODULE_GLOBALS(array)
#define ARRAYG(v) ZEND_MODULE_GLOBALS_ACCESSOR(array, v)