public function intersection(array $search, bool $keepKeys = false): self
    {
        if ($keepKeys) {
            return static::create(
                \array_uintersect(
                    $this->array,
                    $search,
                    static function ($a, $b) {
                        return $a === $b ? 0 : -1;
                    }
                ),
                $this->iteratorClass,
                false
            );
        }

        return static::create(
            \array_values(\array_intersect($this->getArray(), $search)),
            $this->iteratorClass,
            false
        );
    }
public function intersection(array $search, bool $keepKeys = false): self
    {
        if ($keepKeys) {
            return static::create(
                \array_uintersect(
                    $this->array,
                    $search,
                    static function ($a, $b) {
                        return $a === $b ? 0 : -1;
                    }
                ),
                $this->iteratorClass,
                false
            );
        }

        return static::create(
            \array_values(\array_intersect($this->getArray(), $search)),
            $this->iteratorClass,
            false
        );
    }
public function intersection ( array $ search , bool $ keepKeys = false ) : self { if ( $ keepKeys ) { return static :: create ( \ array_uintersect ( $ this -> array , $ search , static function ( $ a , $ b ) { return $ a === $ b ? 0 : - 1 ; } ) , $ this -> iteratorClass , false ) ; } return static :: create ( \ array_values ( \ array_intersect ( $ this -> getArray ( ) , $ search ) ) , $ this -> iteratorClass , false ) ; }
Return an array with all elements found in input array.

@param array $search
@param bool  $keepKeys

@return static
<p>(Immutable)</p>
Return an array with all elements found in input array .