Forum PHP 2025

ReflectionClassConstant::hasType

(PHP 8 >= 8.3.0)

ReflectionClassConstant::hasTypeクラス定数に型が指定されているかを調べる

説明

public ReflectionClassConstant::hasType(): bool

クラス定数に、型が関連付けられているかを調べます。

パラメータ

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

戻り値

型が指定されている場合は、true を返します。 指定されていない場合は、false を返します。

参考

add a note

User Contributed Notes

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