(PECL ds >= 1.0.0)
Ds\Set::clear — 移除所有值
從集合中移除所有值。
此函式沒有參數。
不回傳任何值。
範例 #1 Ds\Set::clear() 範例
<?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 ( )