function Scanner::isIdentifierChar
Checks if the given character is valid for an identifier
Parameters
string $char Character to check:
bool $start If true it will check that the character is: valid to start an identifier
Return value
bool
1 call to Scanner::isIdentifierChar()
- Scanner::scanKeywordOrIdentifier in vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Scanner.php - Keywords and identifiers scanning method
File
-
vendor/
mck89/ peast/ lib/ Peast/ Syntax/ Scanner.php, line 1758
Class
- Scanner
- Base class for scanners.
Namespace
Peast\SyntaxCode
protected function isIdentifierChar($char, $start = true) {
return $char >= "a" && $char <= "z" || $char >= "A" && $char <= "Z" || $char === "_" || $char === "\$" || !$start && $char >= "0" && $char <= "9" || preg_match($start ? $this->idStartRegex : $this->idPartRegex, $char);
}