|
Ds\Set::sortedReturns a sorted copy Description
public Ds\Set Ds\Set::sorted(callable
$comparator = ?)
Returns a sorted copy, using an optional Parameters
Return ValuesReturns a sorted copy of the set. ExamplesExample #1 Ds\Set::sorted example The above example will output something similar to:
Ds\Set Object
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
[4] => 5
)
Example #2 Ds\Set::sorted example using a comparator The above example will output something similar to:
Ds\Set Object
(
[0] => 5
[1] => 4
[2] => 3
[3] => 2
[4] => 1
)
|