php8.5
Home/ Manual/ reflection / reflectionclass/ ReflectionClass::getTraits

ReflectionClass::getTraits

PHP function Edit on GitHub ✎

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

Returns an array of traits used by this class

Description

ReflectionClass::getTraits(): array

Get the array of traits used by this class.

Parameters Parameters

Return Values

Returns an array with trait names in keys and instances of trait's ReflectionClass in values.

Source: reference/reflection/reflectionclass/gettraits.xml · from the official PHP manual (php/doc-en)