Ds\Set::diff

(PECL ds >= 1.0.0)

Ds\Set::diffCreates a new set using values that aren't in another set

说明

public Ds\Set::diff ( Ds\Set $set ) : Ds\Set

Creates a new set using values that aren't in another set.

A \ B = {x ∈ A | x ∉ B}

参数

set

Set containing the values to exclude.

返回值

A new set containing all values that were not in the other set.

See Also

范例

Example #1 Ds\Set::diff() example

<?php
$a 
= new \Ds\Set([123]);
$b = new \Ds\Set([345]);

var_dump($a->diff($b));
?>

以上例程的输出类似于:

object(Ds\Set)#3 (2) {
  [0]=>
  int(1)
  [1]=>
  int(2)
}
相关文章
php dateperiod creates a new dateperiod objectphp domcomment creates a new domcomment objectphp domprocessinginstruction creates a new domprocessinginstruction objectphp deque creates a new deque using a callable to determine which values to includephp map creates a new map using keys that aren t in another mapphp map creates a new map using a callable to determine which pairs to includephp map creates a new map by intersecting keys with another mapphp map creates a new map using values from the current instance and another mapphp map creates a new map using keys of either the current instance or of another map but not of bothphp sequence creates a new sequence using a callable to determine which values to includephp set creates a new instancephp set creates a new set using values that aren t in another setphp set creates a new set using a callable to determine which values to includephp set creates a new set by intersecting values with another setphp set creates a new set using values from the current instance and another setphp set creates a new set using values in either the current instance or in another set but not in bothphp vector creates a new vector using a callable to determine which values to includephp ncurses 函数 set new position and draw a horizontal line using an attributed character and max. n characters longphp ncurses 函数 set new position and draw a vertical line using an attributed character and max. n characters longphp imagick creates a new image as a copy
关注编程学问公众号