Sort
in
Enable sorting a record based on its value.
The class can be used directly with PHP's
- usort and uasort.
- ArrayIterator::uasort.
- ArrayObject::uasort.
Table of Contents
Methods
- __invoke() : int
- The class comparison method.
- sort() : Iterator
- Sort an iterable structure with the class comparison method and maintain index association.
Methods
__invoke()
The class comparison method.
public
__invoke(mixed $valueA, mixed $valueB) : int
The method must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.
Parameters
- $valueA : mixed
- $valueB : mixed
Return values
intsort()
Sort an iterable structure with the class comparison method and maintain index association.
public
sort(iterable<string|int, mixed> $value) : Iterator
Parameters
- $value : iterable<string|int, mixed>