(PECL ds >= 1.0.0)
Ds\Stack::clear — 移除所有值
此函数没有参数。
不返回任何值。
示例 #1 Ds\Stack::clear() 示例
<?php
$stack = new \Ds\Stack([1, 2, 3]);
print_r($stack);
$stack->clear();
print_r($stack);
?>以上示例将输出类似以下内容
Ds\Stack Object
(
[0] => 3
[1] => 2
[2] => 1
)
Ds\Stack Object
(
)