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
 
<PhpToken::isIgnorablePhpToken::tokenize>
^PhpTokenLast updated: Mon, 26 Oct 2026

PhpToken::__toString

(PHP 8)

PhpToken::__toString — Returns the textual content of the token.

Description

public function PhpToken::__toString(): string

Returns the textual content of the token.

Parameters

This function has no parameters.

Return Values

A textual content of the token.

Examples

Example #1 PhpToken::__toString() example

<?php
$token = new PhpToken(T_ECHO, 'echo');
echo $token;

The above examples will output:

echo

See Also


<PhpToken::isIgnorablePhpToken::tokenize>
^PhpTokenLast updated: Mon, 26 Oct 2026