Iterator class responsible for navigating through a list of Tokens.

This class uses practices that are not considered best practice because they are faster. Many of those can be attributed to 'Micro-optimalization' but this class is invoked thus many times that this matters a great deal.

category phpDocumentor
package Reflection
author Mike van Riel
license MIT
link http://phpdoc.org

 Methods

Instantiate a token and populate it.

__construct(string | \mixed[] $content, int | null $type, int $line) 

Parameters

$content

string\mixed[]

The string content of the token or the 3 element notation used by the Tokenizer/ext

$type

intnull

If not literal, the type id as defined by the T_* constants.

$line

int

Line number where the token occurs.

Returns the line number for this token.

getLineNumber() : int

Returns

int

Returns the name for this type of token; or null in case of a literal.

getName() : string | null

Returns

stringnull

 Properties

 

<p>The full content of the token</p>

$content : string

 

<p>Line number where the token resides</p>

$line_number : int

 

<p>Type of the Token; either on of the T_* constants of null in case of a literal</p>

$type : int | null