public function diff( \PhpSets\Set $set ) {
        $entries = $this->entries();
        $iterator = $set->entries();
        $intersect = new \PhpSets\Set;

        // check $set values
        while ( $entries->valid() ) {
            if ( ! $set->has( $entries->current() ) ) {
                $intersect->add( $entries->current() );
            }

            $entries->next();
        }

        // check $additionalSet values
        while ( $iterator->valid() ) {
            if ( ! $this->has( $iterator->current() ) ) {
                $intersect->add( $iterator->current() );
            }

            $iterator->next();
        }

        return $intersect;
    }
public function diff( \PhpSets\Set $set ) {
        $entries = $this->entries();
        $iterator = $set->entries();
        $intersect = new \PhpSets\Set;

        // check $set values
        while ( $entries->valid() ) {
            if ( ! $set->has( $entries->current() ) ) {
                $intersect->add( $entries->current() );
            }

            $entries->next();
        }

        // check $additionalSet values
        while ( $iterator->valid() ) {
            if ( ! $this->has( $iterator->current() ) ) {
                $intersect->add( $iterator->current() );
            }

            $iterator->next();
        }

        return $intersect;
    }
public function diff ( \ PhpSets \ Set $ set ) { $ entries = $ this -> entries ( ) ; $ iterator = $ set -> entries ( ) ; $ intersect = new \ PhpSets \ Set ; // check $set values while ( $ entries -> valid ( ) ) { if ( ! $ set -> has ( $ entries -> current ( ) ) ) { $ intersect -> add ( $ entries -> current ( ) ) ; } $ entries -> next ( ) ; } // check $additionalSet values while ( $ iterator -> valid ( ) ) { if ( ! $ this -> has ( $ iterator -> current ( ) ) ) { $ intersect -> add ( $ iterator -> current ( ) ) ; } $ iterator -> next ( ) ; } return $ intersect ; }
Returns a new Set containing all uncommon items between this and a given Set instance.

@todo  This is not very efficient as it iterates both Sets completely

@param  \PhpSets\Set $set
@return \PhpSets\Set
Returns a new Set containing all uncommon items between this and a given Set instance .