Ds\Stack::push

(PECL ds >= 1.0.0)

Ds\Stack::pushPushes values onto the stack

Descrizione

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

Pushes values onto the stack.

Elenco dei parametri

values

The values to push onto the stack.

Valori restituiti

Nessun valore viene restituito.

Esempi

Example #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);
?>

Il precedente esempio visualizzerà qualcosa simile a:

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

User Contributed Notes

There are no user contributed notes for this page.
To Top