コード例 #1
0
ファイル: Set.php プロジェクト: kgodet/Aldente
 /**
  * Returns the set of values that are in this set, excluding the values that
  * are also in the other set.
  *
  * @param Api\Set|Iterator|array $set
  *
  * @return Api\Set
  */
 public function difference($set)
 {
     $differenceSet = new Set();
     foreach ($this as $value) {
         if ($set->has($value)) {
             $differenceSet->add($value);
         }
     }
     return $differenceSet;
 }