ReflectionClass::getConstants

(PHP 5, PHP 7, PHP 8)

ReflectionClass::getConstantsGets constants

Descrizione

public ReflectionClass::getConstants(?int $filter = null): array

Gets all defined constants from a class, regardless of their visibility.

Elenco dei parametri

filter

The optional filter, for filtering desired constant visibilities. It's configured using the ReflectionClassConstant constants, and defaults to all constant visibilities.

Valori restituiti

An array of constants, where the keys hold the name and the values the value of the constants.

Log delle modifiche

Versione Descrizione
8.0.0 filter has been added.

Vedere anche: