src/Collection/ArrayCollection.php
public function skip(int $step): ArrayCollection
    {
        $items = [];
        $pos = 0;

        foreach ($this->items as $key => $value) {
            if ($pos % $step === 0) {
                $items[$key] = $value;
            }
            $pos++;
        }

        return new static($items);
    }
public function skip(int $step): ArrayCollection
    {
        $items = [];
        $pos = 0;

        foreach ($this->items as $key => $value) {
            if ($pos % $step === 0) {
                $items[$key] = $value;
            }
            $pos++;
        }

        return new static($items);
    }
public function skip ( int $ step ) : ArrayCollection { $ items = [ ] ; $ pos = 0 ; foreach ( $ this -> items as $ key => $ value ) { if ( $ pos % $ step === 0 ) { $ items [ $ key ] = $ value ; } $ pos ++ ; } return new static ( $ items ) ; }
Creates a collection with every n-th element

@param int $step The step number

@return ArrayCollection
Creates a collection with every n - th element