Reserves enough memory to accommodate a given number of elements

public function reserve(
  int $sz,
): void;

Reserves enough memory for $sz elements. If $sz is less than or equal to the current capacity of the current Vector, this method does nothing.

If $sz is less than zero, an exception is thrown.


  • int $sz - The pre-determined size you want for the current Vector.