HH\Lib\Vec\sort

This API is part of the Hack Standard Library, not HHVM itself.

Returns a new vec sorted by the values of the given Traversable

namespace HH\Lib\Vec;

function sort<Tv>(
  Traversable<Tv> $traversable,
  ?(function(Tv,Tv):int) $comparator = null,
): vec<Tv>;

If the optional comparator function isn't provided, the values will be sorted in ascending order.

To sort by some computable property of each value, see Vec\sort_by().

Parameters