public function intersect($array, $assoc = false)
    {
        $function = $this->getBoolable($assoc) ? 'array_intersect_assoc' : 'array_intersect';

        return new static($function($this->items, $this->retrieveValue($array)));
    }
public function intersect($array, $assoc = false)
    {
        $function = $this->getBoolable($assoc) ? 'array_intersect_assoc' : 'array_intersect';

        return new static($function($this->items, $this->retrieveValue($array)));
    }
public function intersect ( $ array , $ assoc = false ) { $ function = $ this -> getBoolable ( $ assoc ) ? 'array_intersect_assoc' : 'array_intersect' ; return new static ( $ function ( $ this -> items , $ this -> retrieveValue ( $ array ) ) ) ; }
Return intersection with Arrayable.
You can specify second argument to with additional index check.

@param mixed $array
@param bool|BooleanContract $assoc
@return Container
Return intersection with Arrayable . You can specify second argument to with additional index check .