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