PHP 8.3.4 Released!

token_name

(PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8)

token_name指定した PHP トークンのシンボル名を取得する

説明

token_name(int $id): string

token_name()は、PHP id 値のシンボル名を返します。

パラメータ

id

トークンの値。

戻り値

id に対応するシンボル名を返します。

例1 token_name() の例

<?php
// 260は T_EVAL トークンのトークン値
echo token_name(260); // -> "T_EVAL"

// 自身の名前にマップするトークン定数
echo token_name(T_FUNCTION); // -> "T_FUNCTION"
?>

参考

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top