array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'ds-vector.push.php', 1 => 'Ds\\Vector::push', 2 => 'Adds values to the end of the vector', ), 'up' => array ( 0 => 'class.ds-vector.php', 1 => 'Ds\\Vector', ), 'prev' => array ( 0 => 'ds-vector.pop.php', 1 => 'Ds\\Vector::pop', ), 'next' => array ( 0 => 'ds-vector.reduce.php', 1 => 'Ds\\Vector::reduce', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/ds/ds/vector/push.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

Ds\Vector::push

(PECL ds >= 1.0.0)

Ds\Vector::pushAdds values to the end of the vector

Опис

public Ds\Vector::push(mixed ...$values): void

Adds values to the end of the vector.

Параметри

values

The values to add.

Значення, що повертаються

Не повертає значень.

Приклади

Приклад #1 Ds\Vector::push() example

<?php
$vector
= new \Ds\Vector();

$vector->push("a");
$vector->push("b");
$vector->push("c", "d");
$vector->push(...["e", "f"]);

print_r($vector);
?>

Поданий вище приклад виведе щось схоже на:

Ds\Vector Object
(
    [0] => a
    [1] => b
    [2] => c
    [3] => d
    [4] => e
    [5] => f
)