public static function getConstants($objectOrClass): array
    {
        try {
            $reflectionClass = self::getReflectionClass($objectOrClass);
            return $reflectionClass->getConstants();
        } catch (\Exception $e) {
            return [];
        }
    }
public static function getConstants($objectOrClass): array
    {
        try {
            $reflectionClass = self::getReflectionClass($objectOrClass);
            return $reflectionClass->getConstants();
        } catch (\Exception $e) {
            return [];
        }
    }
public static function getConstants ( $ objectOrClass ) : array { try { $ reflectionClass = self :: getReflectionClass ( $ objectOrClass ) ; return $ reflectionClass -> getConstants ( ) ; } catch ( \ Exception $ e ) { return [ ] ; } }
Get constants.

@param object|string $objectOrClass
@return string[]
Get constants .