Returns a Vector containing the values of the current Vector

public function values(): Vector<Tv>;

Essentially a copy of the current Vector.

This method is interchangeable with toVector().



This example shows how values() is identical to toVector(). It returns a deep copy of $v, so mutating this new Vector doesn't affect the original.

$v = Vector {'red', 'green', 'blue', 'yellow'};

// Make a deep Vector copy of $v
$v2 = $v->values();

// Modify $v2 by adding an element

// The original Vector $v doesn't include 'purple'