trait_exists

PHP 5 >= 5.4.0, PHP 7, PHP 8
trait_exists - Checks if the trait exists
Manual

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

Parameters

trait

Name of the trait to check

autoload

Whether to autoload if not already loaded.

Return Values

Returns true if trait exists, and false otherwise.

Function trait_exists:

  • Manual

Class/Object Information Functions

Most used PHP functions