CakeFest 2025 Madrid: The Official CakePHP Conference

Ds\Set::remove

(PECL ds >= 1.0.0)

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

Description

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

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

Parameters

values

The values to remove.

Return Values

No value is returned.

Examples

Example #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);
?>

The above example will output something similar to:

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

User Contributed Notes

There are no user contributed notes for this page.
To Top

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant