public function hasConstant($name)
    {
        if (isset($this->constants[$name])) {
            return true;
        }

        $extendsClassDefinition = $this->getExtendsClassDefinition();
        if ($extendsClassDefinition) {
            if ($extendsClassDefinition->hasConstant($name)) {
                return true;
            }
        }

        /*
         * Check if constant is defined in interfaces
         */
        return $this->hasConstantFromInterfaces($name);
    }