Ds\Stack::push

(PECL ds >= 1.0.0)

Ds\Stack::pushPushes values onto the stack

Description

publicDs\Stack::push(mixed...$values): void

Pushes values onto the stack.

Liste de paramètres

values

The values to push onto the stack.

Valeurs de retour

Aucune valeur n'est retournée.

Exemples

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

Résultat de l'exemple ci-dessus est similaire à :

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