public function getNextPlaceholder(?int &$position = null): ?string
{
$result = null;
$length = $this->length - 1;
while ($this->position < $length) {
$pos = $this->position++;
match ($this->sql[$pos]) {
':' => ($word = $this->parseWord()) === ''
? $this->skipChars(':')
: $result = ':' . $word,
'"', "'" => $this->skipQuotedWithoutEscape($this->sql[$pos]),
'e', 'E' => $this->sql[$this->position] === "'"
? ++$this->position && $this->skipQuotedWithEscape("'")
: $this->skipIdentifier(),
'$' => $this->skipQuotedWithDollar(),
'-' => $this->sql[$this->position] === '-'
? ++$this->position && $this->skipToAfterChar("\n")
: null,
'/' => $this->sql[$this->position] === '*'
? ++$this->position && $this->skipToAfterString('*/')
: null,
'_','a', 'b', 'c', 'd', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u',
'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q',
'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' => $this->skipIdentifier(),
default => null,
};
if ($result !== null) {
$position = $pos;
return $result;
}
}
return null;
}
Signup or Login in order to comment.