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

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

namespace HH\Lib\Keyset;

function sort<Tv as arraykey>(
    Traversable<Tv> $traversable,
  ?(function(Tv,Tv):int) $comparator = NULL,
): keyset<Tv>;

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