public function valid() { if (!$this->generator) { $this->rewind(); } return $this->generator->valid(); }