Php/docs/ds-set.clear

提供:Dev Guides
< Php
移動先:案内検索

Ds\Set::clear

(PECL ds >= 1.0.0)

Ds\Set::clearRemoves all values


説明

public Ds\Set::clear ( ) : void

Removes all values from the set.


パラメータ

この関数にはパラメータはありません。


返り値

値を返しません。


例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
(
)