MathPHP\SetTheory\Set::remove PHP Méthode

remove() public méthode

Remove an element from the set Does nothing if the element does not exist in the set.
public remove ( mixed $x ) : Set
$x mixed
Résultat Set (this set)
    public function remove($x) : Set
    {
        unset($this->A[$this->getKey($x)]);
        return $this;
    }

Usage Example

 /**
  * @dataProvider dataProviderForRemove
  */
 public function testRemove(array $A, $x, array $R)
 {
     $setA = new Set($A);
     $setR = new Set($R);
     $setA->remove($x);
     $this->assertEquals($setR, $setA);
 }