code: public function valid()
      {
          if ($this->items === null) {
              return false;
          }
          $key = key($this->items);
          return ($key !== null && $key !== false);
      }
docs: Checks if current position is valid.
  
  @return boolean