Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Scanner.php

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\Syntax

Code

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);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal