编程学问
  • 文章
  • 问题
  • 读书
  • 关于
  • 登录
  • « Ds\Stack::capacity
  • Ds\Stack::__construct »
  • PHP Manual
  • Stack
  • Removes all values

Ds\Stack::clear

(PECL ds >= 1.0.0)

Ds\Stack::clear — Removes all values

说明

public Ds\Stack::clear ( void ) : void

Removes all values from the stack.

参数

此函数没有参数。

返回值

没有返回值。

范例

Example #1 Ds\Stack::clear() example

<?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
(
)
相关文章
php collection removes all valuesphp deque updates all values by applying a callback function to each valuephp deque removes all values from the dequephp deque joins all values together as a stringphp deque returns the sum of all values in the dequephp map removes all valuesphp pair removes all valuesphp priorityqueue removes all valuesphp queue removes all valuesphp sequence joins all values together as a stringphp sequence returns the sum of all values in the sequencephp set removes all valuesphp set joins all values together as a stringphp set removes all given values from the setphp stack removes all valuesphp vector removes all valuesphp vector returns the result of adding all given values to the vectorphp eventhttprequest removes all output headers from the header list of the requestphp ldap 函数 get all binary values from a result entryphp hyperwave api 函数 returns all values of the attribute
关注编程学问公众号
编程学问网 湘ICP备20001732号