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

Returns a new vec containing each element of the given Traversable exactly once, where uniqueness is determined by calling the given scalar function on the values

namespace HH\Lib\Vec;

function unique_by<Tv, Ts as arraykey>(
  Traversable<Tv> $traversable,
  (function(Tv):Ts) $scalar_func,
): vec<Tv>;

In case of duplicate scalar keys, later values will overwrite previous ones.

For arraykey elements, see Vec\unique().