Php/docs/ds-set.remove

提供:Dev Guides
< Php
2020年12月14日 (月) 10:18時点におけるNotes (トーク | 投稿記録)による版 (autoload)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先:案内検索

Ds\Set::remove

(PECL ds >= 1.0.0)

Ds\Set::removeRemoves all given values from the set


説明

public Ds\Set::remove ( mixed ...$values ) : void

Removes all given values from the set, ignoring any that are not in the set.


パラメータ

values
The values to remove.


返り値

値を返しません。


例1 Ds\Set::remove() example

<?php$set = new \Ds\Set([1, 2, 3, 4, 5]);$set->remove(1);            // Remove 1$set->remove(1, 2);         // Can't find 1, but remove 2$set->remove(...[3, 4]);    // Remove 3 and 4var_dump($set);?>

上の例の出力は、 たとえば以下のようになります。


object(Ds\Set)#1 (1) {
  [0]=>
  int(5)
}