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

Ds\Queue::clear

(PECL ds >= 1.0.0)

Ds\Queue::clear — Removes all values

说明

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

Removes all values from the queue.

参数

此函数没有参数。

返回值

没有返回值。

范例

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

<?php
$queue 
= new \Ds\Queue([1, 2, 3]);
print_r($queue);

$queue->clear();
print_r($queue);
?>

以上例程的输出类似于:

Ds\Queue Object
(
    [0] => 1
    [1] => 2
    [2] => 3
)
Ds\Queue Object
(
)
相关文章
php collection removes all valuesphp 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 priorityqueue pushes values into the queuephp queue removes all valuesphp set removes all valuesphp set removes all given values from the setphp set returns the sum of all values in the setphp stack removes all valuesphp vector updates all values by applying a callback function to each valuephp vector removes all valuesphp vector joins all values together as a stringphp vector returns the result of adding all given values to the vectorphp vector returns the sum of all values in the vectorphp id3 函数 get all possible genre valuesphp solrclient removes all documents matching any of the queries
关注编程学问公众号
编程学问网 湘ICP备20001732号