src/Map.php
public function diff($collection, $comparison = Map::LOOSE)
    {
        $func = ($comparison === Map::LOOSE ? 'array_diff' : 'array_diff_assoc');
        return new static(
            $func($this->toArray(), $this->collection_to_array($collection))
        );
    }
public function diff($collection, $comparison = Map::LOOSE)
    {
        $func = ($comparison === Map::LOOSE ? 'array_diff' : 'array_diff_assoc');
        return new static(
            $func($this->toArray(), $this->collection_to_array($collection))
        );
    }
public function diff ( $ collection , $ comparison = Map :: LOOSE ) { $ func = ( $ comparison === Map :: LOOSE ? 'array_diff' : 'array_diff_assoc' ) ; return new static ( $ func ( $ this -> toArray ( ) , $ this -> collection_to_array ( $ collection ) ) ) ; }
Return a new map containing those keys and values that are not present
in the given collection.

If comparison is loose, then only those elements whose values match will
be removed.  Otherwise, comparison is strict, and elements whose keys
and values match will be removed.

@param Map|Arrayable|Jsonable|Traversable|object|array $collection
@param enum $comparison
@return new static
@api
Return a new map containing those keys and values that are not present in the given collection .