ReflectionClass::getTraits

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

ReflectionClass::getTraits返回這個類所使用的 traits 數(shù)組

說明

public ReflectionClass::getTraits(): array

警告

本函數(shù)還未編寫文檔,僅有參數(shù)列表。

參數(shù)

此函數(shù)沒有參數(shù)。

返回值

返回了一個數(shù)組,鍵是 trait 的名稱,值是 trait 實例的 ReflectionClass。 出現(xiàn)錯誤的情況下返回 null