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

Ds\Set::clear

(PECL ds >= 1.0.0)

Ds\Set::clear — Removes all values

说明

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

Removes all values from the set.

参数

此函数没有参数。

返回值

没有返回值。

范例

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

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

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

以上例程的输出类似于:

Ds\Set Object
(
    [0] => 1
    [1] => 2
    [2] => 3
)
Ds\Set Object
(
)
相关文章
php collection removes all valuesphp deque removes all values from the dequephp map removes all valuesphp pair removes all valuesphp priorityqueue removes all valuesphp queue removes all valuesphp set removes all valuesphp set determines if the set contains all valuesphp set creates a new set using values that aren t in another setphp set joins all values together as a stringphp set returns the result of adding all given values to the setphp set removes all given values from the setphp set returns the sum of all values in the setphp stack removes all valuesphp vector removes all valuesphp vector returns the sum of all values in the vectorphp gnupg 函数 removes all keys which were set for decryption beforephp gnupg 函数 removes all keys which were set for encryption beforephp gnupg 函数 removes all keys which were set for signing beforephp solrclient removes all documents matching any of the queries
关注编程学问公众号
编程学问网 湘ICP备20001732号