|
Ds\Set::sortedReturns a sorted copy 説明
public Ds\Set Ds\Set::sorted(callable
$comparator = ?)
Returns a sorted copy, using an optional パラメータ
戻り値Returns a sorted copy of the set. 例例1 Ds\Set::sorted example 上の例の出力は、 たとえば以下のようになります。
Ds\Set Object
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
[4] => 5
)
例2 Ds\Set::sorted example using a comparator 上の例の出力は、 たとえば以下のようになります。
Ds\Set Object
(
[0] => 5
[1] => 4
[2] => 3
[3] => 2
[4] => 1
)
|