ArrayIterator::uasort

(PHP 5 >= 5.2.0, PHP 7)

ArrayIterator::uasortSort with a user-defined comparison function and maintain index association

Opis

public ArrayIterator::uasort ( callable $cmp_function ) : void

This method sorts the elements such that indices maintain their correlation with the values they are associated with, using a user-defined comparison function.

Informacja:

Jeśli dwa elementy zostaną uznane za identyczne ich kolejność względem siebie w posortowanej tablicy jest nieokreślona.

Parametry

cmp_function

Funkcja porównująca musi zwrócić liczbę całkowitą mniejszą, równą lub większą od zera jeśli pierwszy argument jest uważany za odpowiednio mniejszy, równy lub większy od drugiego. Przed PHP 7.0.0 ta liczba musiała być z zakresu -2147483648 do 2147483647.

callback ( mixed $a, mixed $b ) : int

Zwracane wartości

Nie jest zwracana żadna wartość.

Zobacz też:

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top