trait_exists

Checks if the trait exists

Description

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

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.