<?php
$vector = new \Ds\Vector([4, 5, 1, 3, 2]);
$sorted = $vector->sorted(function($a, $b) {
return $b <=> $a;
});
print_r($sorted);
?>
The above example will output
something similar to:
Ds\Vector Object
(
[0] => 5
[1] => 4
[2] => 3
[3] => 2
[4] => 1
)