array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'function.trait-exists.php', 1 => 'trait_exists', 2 => 'Checks if the trait exists', ), 'up' => array ( 0 => 'ref.classobj.php', 1 => 'Функції Класів чи Об\'єктів', ), 'prev' => array ( 0 => 'function.property-exists.php', 1 => 'property_exists', ), 'next' => array ( 0 => 'book.ctype.php', 1 => 'Ctype', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/classobj/functions/trait-exists.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

trait_exists

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

trait_existsChecks if the trait exists

Опис

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

Параметри

trait

Name of the trait to check

autoload

Whether to autoload if not already loaded.

Значення, що повертаються

Returns true if trait exists, and false otherwise.