/** * 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; }