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

This function is available as Vec\range() in Facebook's www repository.

Returns a new vec containing the range of numbers from $start to $end inclusive, with the step between elements being $step if provided, or 1 by default


namespace HH\Lib\Vec;

function range<Tv as num>(
  Tv $start,
  Tv $end,
  ?Tv $step = null,
): vec<Tv>;

If $start > $end, it returns a descending range instead of an empty one.


  • Tv $start
  • Tv $end
  • ?Tv $step = null