Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<PhpTokenPhpToken::getTokenName>
^PhpTokenLast updated: Mon, 26 Oct 2026

PhpToken::__construct

(PHP 8)

PhpToken::__construct — Returns a new PhpToken object

Description

final public function PhpToken::__construct(
    int $id,
    string $text,
    int $line = -1,
    int $pos = -1
)

Returns a new PhpToken object

Parameters

id

One of the T_* constants (see List of Parser Tokens), or an ASCII codepoint representing a single-char token.

text

The textual content of the token.

line

The starting line number (1-based) of the token.

pos

The starting position (0-based) in the tokenized string (the number of bytes).

See Also


<PhpTokenPhpToken::getTokenName>
^PhpTokenLast updated: Mon, 26 Oct 2026