Forum PHP 2025

ReflectionClassConstant::getType

(PHP 8 >= 8.3.0)

ReflectionClassConstant::getTypeクラス定数の型を取得する

説明

public ReflectionClassConstant::getType(): ?ReflectionType

クラス定数に関連付けられた型を取得します。

パラメータ

この関数にはパラメータはありません。

戻り値

定数に型が指定されている場合、ReflectionType を返します。 指定されていない場合は、null を返します。

参考

add a note

User Contributed Notes

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