(PECL ds >= 1.0.0)
Ds\Vector::clear — 移除所有值
此函式沒有參數。
不回傳任何值。
範例 #1 Ds\Vector::clear() 範例
<?php
$vector = new \Ds\Vector([1, 2, 3]);
print_r($vector);
$vector->clear();
print_r($vector);
?>
上述範例將輸出類似以下的內容:
Ds\Vector Object ( [0] => 1 [1] => 2 [2] => 3 ) Ds\Vector Object ( )