Name

trait_exists

Synopsis

bool trait_exists(string name[, bool autoload])

Returns true if a trait with the same name as the string has been defined; if not, it returns false. The comparison for trait names is case-insensitive. If autoload is set and is true, the autoloader attempts to load the trait before checking its existence.

Get Programming PHP, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.