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

Ds\Stack::push

(PECL ds >= 1.0.0)

Ds\Stack::pushPushes values onto the stack

Опис

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

Pushes values onto the stack.

Параметри

values

The values to push onto the stack.

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

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

Приклади

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

<?php
$stack
= new \Ds\Stack();

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

print_r($stack);
?>

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

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