From 7fc85ba263105ddde601163ffdf6f2e297356867 Mon Sep 17 00:00:00 2001 From: George Peter Banyard Date: Sun, 13 Jun 2021 16:41:24 +0100 Subject: [PATCH] Update array sorting docs These always return true, even in PHP 7 Clarify sorting is unstable prior to PHP 8.0 Normalize the docs between the functions --- language-snippets.ent | 5 ++- reference/array/functions/arsort.xml | 22 +++++----- reference/array/functions/asort.xml | 29 +++++++++----- reference/array/functions/krsort.xml | 24 ++++++----- reference/array/functions/ksort.xml | 60 +++++++++++++++++++++++----- reference/array/functions/rsort.xml | 28 +++++++------ reference/array/functions/sort.xml | 24 ++++++----- reference/array/functions/uasort.xml | 24 +++++------ reference/array/functions/uksort.xml | 24 ++++++----- reference/array/functions/usort.xml | 32 ++++++--------- reference/array/sorting.xml | 25 ++++++------ 11 files changed, 180 insertions(+), 117 deletions(-) diff --git a/language-snippets.ent b/language-snippets.ent index 5240b8853844..305a7609f469 100644 --- a/language-snippets.ent +++ b/language-snippets.ent @@ -137,7 +137,8 @@ from one file system to another.'> - If two members compare as equal, their relative order in the sorted array is undefined. + Prior to PHP 8.0.0, if two members compare as equal, + their relative order in the sorted array is undefined. '> @@ -657,6 +658,8 @@ searched for within the This function may diff --git a/reference/array/functions/arsort.xml b/reference/array/functions/arsort.xml index edd9e4b60bdd..98a133bae2e2 100644 --- a/reference/array/functions/arsort.xml +++ b/reference/array/functions/arsort.xml @@ -13,8 +13,9 @@ intflagsSORT_REGULAR - This function sorts an array in descending order such that array indices maintain their - correlation with the array elements they are associated with. + Sorts array in place in descending order, + such that its keys maintain their correlation with the values they + are associated with. This is used mainly when sorting associative arrays where the actual @@ -38,12 +39,14 @@ + &reftitle.returnvalues; - &return.success; + &return.true.always; + &reftitle.examples; @@ -76,15 +79,16 @@ c = apple + &reftitle.seealso; - - - asort - &seealso.array.sorting; - - + + sort + asort + &seealso.array.sorting; + +