IdentifierToken extends AbstractToken

FinalYes

A special token if this token is a T_IDENTIFIER token: With a line like "foo = bar", "foo" is created as TokenIdentifier TokenInterface (as opposed to Token) having a TokenType::T_IDENTIFIER token.

The only difference to all other tokens is that TokenIdentifier tokens quote any "." (dots) in their value with a backslash when output. This is mostly used in backend when rendering source of TokenLine's.

Note we do not explicitly check if TokenType::T_IDENTIFIER is given in __construct() at the moment for performance reasons and inheritance considerations.

Tags
internal:

Internal tokenizer structure.

Table of Contents

Properties

$column  : int
$line  : int
$value  : string

Methods

__construct()  : mixed
__serialize()  : array<string|int, mixed>
Do not store line and column when structure is serialized to cache.
__toString()  : string
getColumn()  : int
getLine()  : int
getType()  : TokenType
getValue()  : string

Properties

Methods

__construct()

public __construct(TokenType $type, string $value[, int $line = 0 ][, int $column = 0 ]) : mixed
Parameters
$type : TokenType
$value : string
$line : int = 0
$column : int = 0

__serialize()

Do not store line and column when structure is serialized to cache.

public __serialize() : array<string|int, mixed>

Not storing $line and $column reduces the cache size by about 1/3 since we're typically storing a lot of tokens.

Return values
array<string|int, mixed>

__toString()

public __toString() : string
Return values
string

getColumn()

public getColumn() : int
Return values
int

getLine()

public getLine() : int
Return values
int

getValue()

public getValue() : string
Return values
string

        
On this page

Search results