toks = $toks; } public function current(): ?string { return ($this->ptr >= count($this->toks) ? null : $this->toks[$this->ptr]); } public function read(): ?string { $v = $this->current(); $this->next(); return $v; } public function next(): ?string { if ($this->ptr < count($this->toks)) { $this->ptr++; return ($this->ptr < count($this->toks) ? $this->toks[$this->ptr] : null); } return null; } }