src/Zicht/Itertools/lib/SliceIterator.php
public function valid()
    {
        while ($this->index < $this->start) {
            if (parent::valid()) {
                $this->index += 1;
                parent::next();
            } else {
                return false;
            }
        }

        if (null === $this->end || $this->index < $this->end) {
            return parent::valid();
        }

        return false;
    }
public function valid()
    {
        while ($this->index < $this->start) {
            if (parent::valid()) {
                $this->index += 1;
                parent::next();
            } else {
                return false;
            }
        }

        if (null === $this->end || $this->index < $this->end) {
            return parent::valid();
        }

        return false;
    }
{@inheritdoc}