rsort().
Creates a Closure that sorts an array or iterable in reverse (descending) order. Keys are NOT maintained.
/**
* @param int $flag PHP sort flag constant.
* @return Closure(iterable<int|string, mixed>):mixed[]
*/
Arrays\rsort(int $flag = SORT_REGULAR): ClosureWhen Arrays\rsort() is called, it returns the following Closure which can be used like a regular function.
/**
* @param iterable<int|string, mixed> $source
* @return mixed[]
*/
$function (iterable $source): arrayThis can be used to create a simple closure which can be used as a regular function.
$desc = Arrays\rsort();
print_r($desc([1, 3, 2])); // [3, 2, 1]This can be called inline using currying.
print_r(Arrays\rsort()([1, 3, 2])); // [3, 2, 1]