function Scanner::charAt
Return the character at the given index in the source code or null if the end is reached.
Parameters
int $index Index, if not given it will use the current index:
Return value
string|null
13 calls to Scanner::charAt()
- Scanner::consumeExponentPart in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Scanner.php - Consumes the exponent part of a number
- Scanner::consumeNumbers in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Scanner.php - Consumes the maximum number of digits
- Scanner::consumeUnicodeEscapeSequence in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Scanner.php - Consumes an unicode escape sequence
- Scanner::consumeUntil in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Scanner.php - Consumes characters until one of the given characters is found
- Scanner::error in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Scanner.php - Throws a syntax error
File
-
vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Scanner.php, line 633
Class
- Scanner
- Base class for scanners.
Namespace
Peast\SyntaxCode
public function charAt($index = null) {
if ($index === null) {
$index = $this->index;
}
return $index < $this->length ? $this->source[$index] : null;
}