public function only(array $keys): self
    {
        $array = $this->getArray();

        return static::create(
            \array_intersect_key($array, \array_flip($keys)),
            $this->iteratorClass,
            false
        );
    }
public function only(array $keys): self
    {
        $array = $this->getArray();

        return static::create(
            \array_intersect_key($array, \array_flip($keys)),
            $this->iteratorClass,
            false
        );
    }
public function only ( array $ keys ) : self { $ array = $ this -> getArray ( ) ; return static :: create ( \ array_intersect_key ( $ array , \ array_flip ( $ keys ) ) , $ this -> iteratorClass , false ) ; }
Get a subset of the items from the given array.

@param mixed[] $keys

@return static
<p>(Immutable)</p>
Get a subset of the items from the given array .