SPL
Table of Contents
Functions
- class_parents_uses() : array<class-string, class-string>|false
- Return the traits used by the parent classes of the given class.
- class_parents_traits_uses() : array<class-string, class-string>|false
- Return the traits used by the parent classes of the given class, recursively.
- class_traits_uses() : array<class-string, class-string>|false
- Return the traits used by the given class or trait, recursively.
Functions
class_parents_uses()
Return the traits used by the parent classes of the given class.
class_parents_uses(object|string $object_or_class[, bool $autoload = true ]) : array<class-string, class-string>|false
This function returns an array with the names of the traits that the parents of the given object_or_class use.
Parameters
- $object_or_class : object|string
-
An object or class name.
- $autoload : bool = true
-
Whether to autoload if not already loaded.
Return values
array<class-string, class-string>|false —An array on success, or false when the class doesn't exist.
class_parents_traits_uses()
Return the traits used by the parent classes of the given class, recursively.
class_parents_traits_uses(object|string $object_or_class[, bool $autoload = true ]) : array<class-string, class-string>|false
This function returns an array with the names of the traits that the parent classes of the given object_or_class uses, including traits used within those traits.
Parameters
- $object_or_class : object|string
-
An object or class name.
- $autoload : bool = true
-
Whether to autoload if not already loaded.
Return values
array<class-string, class-string>|false —An array on success, or false when the class doesn't exist.
class_traits_uses()
Return the traits used by the given class or trait, recursively.
class_traits_uses(object|string $object_or_class[, bool $autoload = true ]) : array<class-string, class-string>|false
This function returns an array with the names of the traits that the given object_or_class uses, including traits used by those traits, recursively. This does however not include any traits used by a parent class.
Parameters
- $object_or_class : object|string
-
An object, class name or trait name.
- $autoload : bool = true
-
Whether to autoload if not already loaded.
Return values
array<class-string, class-string>|false —An array on success, or false when the class doesn't exist.