Splice the current Vector in place

public function splice(
  int $offset,
  ?int $len = NULL,
): void;

This function provides the functionality of array_splice() for Vectors (except that splice() does not permit specifying replacement values. If a third ("replacement values") parameter is specified, an exception is thrown.

Note that this function modifies the current Vector in place.


  • int $offset - The (0-based) key at which to begin the splice. If negative, then it starts that far from the end of the current Vector.
  • ?int $len = NULL - The length of the splice. If null, then the current Vector is spliced until its end.