HH\Lib\Dict\sort

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

Returns a new dict sorted by the values of the given KeyedTraversable

namespace HH\Lib\Dict;

function sort<Tk as arraykey, Tv>(
    KeyedTraversable<Tk, Tv> $traversable,
  ?(function(Tv,Tv):int) $value_comparator = NULL,
): dict<Tk, Tv>;

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

Parameters