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
Table of Contents
Properties
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
$column
protected
int
$column
= 0
$line
protected
int
$line
= 0
$value read-only
protected
string
$value
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
stringgetColumn()
public
getColumn() : int
Return values
intgetLine()
public
getLine() : int
Return values
intgetType()
public
getType() : TokenType
Return values
TokenTypegetValue()
public
getValue() : string