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

Breadcrumb

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

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

... See full list

File

vendor/mck89/peast/lib/Peast/Syntax/Scanner.php, line 633

Class

Scanner
Base class for scanners.

Namespace

Peast\Syntax

Code

public function charAt($index = null) {
    if ($index === null) {
        $index = $this->index;
    }
    return $index < $this->length ? $this->source[$index] : null;
}

API Navigation

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