« property_exists
Ctype »

trait_exists

(PHP 5 >= 5.4.0, PHP 7, PHP 8)

trait_exists — トレイトが存在するかどうかを調べる

説明

function trait_exists(string $trait, bool $autoload = true): bool

パラメータ

trait

調べたいトレイトの名前。

autoload

まだロードされていない場合に オートロード するかどうか。

戻り値

トレイトが存在する場合に true、存在しない場合に false を返します。

関連キーワード:
トレイト   trait   exists   autoload   ロード   property   Ctype   オート
関連する関数・ページ:
function.class-uses   function.get-declared-traits   ref.classobj   reflectionclass.gettraits   language.enumerations.traits   function.class-exists