protected function copy_until($chars) { $pos = $this->pos; $len = strcspn($this->doc, $chars, $pos); $this->pos += $len; $this->char = $this->pos < $this->size ? $this->doc[$this->pos] : null; // next return substr($this->doc, $pos, $len); }