A função Ds \ Vector :: push () pode adicionar valores ao final de um vetor.
Sintaxe
public void Ds\Vector::push([ mixed $...values ] )
A função Ds \ Vector :: push () não retorna nenhum valor.
Exemplo 1
<?php
$array1 = new \Ds\Vector([10, 20, 30, 40, 50]);
echo("The original vector elements: \n");
print_r($array1);
$array1->push(60);
echo("\n After appending the elements to vector: \n");
print_r($array1);
?>
Exemplo 2
<?php
$array1 = new \Ds\Vector([10, 20, 30, 40, 50]);
echo("The original vector elements: \n");
print_r($arr1);
$arr1->push(...[60, 70]);
echo("\ After appending the elements to vector \n");
print_r($array1);
?>