Ds\Stack::push
(PECL ds >= 1.0.0)
Ds\Stack::push — 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
)
+添加备注
用户贡献的备注
此页面尚无用户贡献的备注。