Returns an ImmVector containing the values after the n-th element of the current Pair

public function skip(
  int $n,
): ImmVector<mixed>;

n is 1-based. So the first element is 1, the second 2, etc. There is no element 3 in a Pair, but if you specify an element greater than or equal to 2, it will just return empty. If you specify 0, it will return all the elements in the Pair.


  • int $n - The last element to be skipped; the $n+1 element will be the first one in the returned ImmVector.



$p = Pair {'foo', -1.5};

// Skipping 0 returns an ImmVector of both values

// Skipping 1 returns an ImmVector of the second value

// Skipping more than 1 returns an empty ImmVector