array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'ds-set.remove.php', 1 => 'Ds\\Set::remove', 2 => 'Removes all given values from the set', ), 'up' => array ( 0 => 'class.ds-set.php', 1 => 'Ds\\Set', ), 'prev' => array ( 0 => 'ds-set.reduce.php', 1 => 'Ds\\Set::reduce', ), 'next' => array ( 0 => 'ds-set.reverse.php', 1 => 'Ds\\Set::reverse', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/ds/ds/set/remove.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

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 4

var_dump($set);
?>

Поданий вище приклад виведе щось схоже на:

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