get_declared_traits

Returns an array of all declared traits

Syntax

get_declared_traits ( void ) : array

Return

Returns an array with names of all declared traits in values. Returns NULL in case of a failure.

Examples

<?

trait mytrait
{
}

$return = get_declared_traits();

print_r($return);

?>
Array
(
    [0] => mytrait
)

PHP

Home Menu