HH\Lib\Dict\chunk

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

This function is available as Dict\chunk() in Facebook's www repository.

Returns a vec containing the original dict split into chunks of the given size

Description

namespace HH\Lib\Dict;

function chunk<Tk as arraykey, Tv>(
  KeyedTraversable<Tk, Tv> $traversable,
  int $size,
): vec<dict<Tk, Tv>>;

If the original dict doesn't divide evenly, the final chunk will be smaller.

Parameters