public function filterByKeys(array $keys)
    {
        /** @noinspection PhpMethodParametersCountMismatchInspection */
        $newInstance = new self();
        $newInstance->setArray(array_filter($this->array, function ($key) use ($keys) {
            return array_search($key, $keys) !== false;
        }, ARRAY_FILTER_USE_KEY));
        return $newInstance;
    }
public function filterByKeys(array $keys)
    {
        /** @noinspection PhpMethodParametersCountMismatchInspection */
        $newInstance = new self();
        $newInstance->setArray(array_filter($this->array, function ($key) use ($keys) {
            return array_search($key, $keys) !== false;
        }, ARRAY_FILTER_USE_KEY));
        return $newInstance;
    }
public function filterByKeys ( array $ keys ) { /** @noinspection PhpMethodParametersCountMismatchInspection */ $ newInstance = new self ( ) ; $ newInstance -> setArray ( array_filter ( $ this -> array , function ( $ key ) use ( $ keys ) { return array_search ( $ key , $ keys ) !== false ; } , ARRAY_FILTER_USE_KEY ) ) ; return $ newInstance ; }
returns a clone of this ArrayList, filtered by the given array keys
@param array $keys
@return ArrayListInterface|ArrayListTrait
returns a clone of this ArrayList filtered by the given array keys