|
Ds\Vector::sortedReturns a sorted copy. Beschreibung
public Ds\Vector Ds\Vector::sorted
([ callable
$comparator
] )
Returns a sorted copy, using an optional Parameter-Liste
RückgabewerteReturns a sorted copy of the vector. BeispieleBeispiel #1 Ds\Vector::sorted example
<?phpDas oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:
Ds\Vector Object
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
[4] => 5
)
Beispiel #2 Ds\Vector::sorted example using a comparator
<?phpDas oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:
Ds\Vector Object
(
[0] => 5
[1] => 4
[2] => 3
[3] => 2
[4] => 1
)
|