Constants are allowed to be defined after their first use.
970399
Reference getInitializingReferenceForConstants() {
    int size = references.size();
    for (int i = 0; i < size; i++) {
      if (isInitializingDeclarationAt(i) || isInitializingAssignmentAt(i)) {
        return references.get(i);
      }
    }
    return null;
  }
985090
private function define_constants() {
		// Set our base directory here
		if ( !defined( 'PAULUS_BASE_DIR' ) ) {
			define( 'PAULUS_BASE_DIR', __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR );
		}

		// Quick function to make directory defining easier
		$dir_rel_path = function( $dir_name ) {
			return PAULUS_BASE_DIR . $dir_name . DIRECTORY_SEPARATOR;
		};

		if ( !defined( 'PAULUS_CONFIG_DIR' ) ) {
			define( 'PAULUS_CONFIG_DIR', $dir_rel_path( 'configs' ) );
		}
		if ( !defined( 'PAULUS_APP_DIR' ) ) {
			define( 'PAULUS_APP_DIR',  $dir_rel_path( 'application' ) );
		}
		if ( !defined( 'PAULUS_EXTERNAL_LIB_DIR' ) ) {
			define( 'PAULUS_EXTERNAL_LIB_DIR', $dir_rel_path( 'vendor' ) );
		}
	}
607970
def initial_definitions
      definitions = Definition::RubyObject.new(
        :name          => 'root',
        :type          => :root,
        :instance_type => :instance,
        :inherit_self  => false
      )

      definitions.parents = [
        definitions.constant_proxy('Object', RubyLint.registry)
      ]

      definitions.define_self

      return definitions
    end
1026867
public function addConstant(ClassConstant $constant)
    {
        if (isset($this->constants[$constant->getName()])) {
            throw new CompilerException("Constant '".$constant->getName()."' was defined more than one time");
        }

        $this->constants[$constant->getName()] = $constant;
    }
1302950
def p_variable_definition1(self, p):
        
        p[0] = VariableDefinition(name=p[2], type=p[4], default_value=p[5])
394215
private T createOrThrow(String name) {
        T constant = constants.get(name);
        if (constant == null) {
            final T tempConstant = newConstant(nextId(), name);
            constant = constants.putIfAbsent(name, tempConstant);
            if (constant == null) {
                return tempConstant;
            }
        }

        throw new IllegalArgumentException(String.format("'%s' is already in use", name));
    }
1345973
public function addConstant(Constant $constant): void
    {
        $this->constants[(string) $constant->getFqsen()] = $constant;
    }
1254242
private void initVariables() {
        if (this.currentChunk == null) {
            this.currentChunk = new Instances(this.getModelContext());
        }

        if (this.classDistributions == null) {
            this.classDistributions = new long[this.getModelContext().classAttribute().numValues()];

            for (int i = 0; i < this.classDistributions.length; i++) {
                this.classDistributions[i] = 0;
            }
        }
    }
210694
def after_initialize
      @comments ||= {}

      @associations    = {}
      @definitions     = initial_definitions
      @constant_loader = ConstantLoader.new(:definitions => @definitions)
      @scopes          = [@definitions]
      @value_stack     = NestedStack.new
      @variable_stack  = NestedStack.new
      @ignored_nodes   = []
      @visibility      = :public

      reset_docstring_tags
      reset_method_type

      @constant_loader.bootstrap
    end
535258
private LNGVector<Variable> initializeConstraint(final EncodingResult result, final Variable[] vars) {
    result.reset();
    this.result = result;
    this.cardinalityInvars = new LNGVector<>(vars.length);
    final LNGVector<Variable> cardinalityOutvars = new LNGVector<>(vars.length);
    for (final Variable var : vars) {
      this.cardinalityInvars.push(var);
      cardinalityOutvars.push(this.result.newVariable());
    }
    return cardinalityOutvars;
  }
501630
public function defines() {
        $defines = get_defined_constants();
        $ret = array(); $offset = -1;
        while ($def = array_slice($defines, $offset--, 1)) {
            $key = key($def);
            $value = current($def);
            if ($key  == 'FIRST_APP_CONSTANT') break;
            $ret[$key ] = $value;
        }
        return $ret;
    }
1120066
def all_loaded_constants
      constants
        .map { |c| const_get(c) }
        .select { |a| a.respond_to?(:loaded?) && a.loaded? }
    end
1250071
protected function defineConstants()
    {
        if (! empty($this->constants)) {
            foreach ($this->constants as $key => $value) {
                defined($key) || define($key, $value);
            }
        }

        return $this;
    }
1080068
protected function initConstants($library_name)
	{
		if (!isset($this->params[$library_name]['constants']))
			return;

		foreach ((array)$this->params[$library_name]['constants'] as $constant_name => $constant_value)
			defined($constant_name) or define($constant_name, $constant_value);
	}
547435
static ConstantClassInfo make(ConstantPool cp, String className, int dim) {
        ConstantInfo ci = new ConstantClassInfo(cp, className, dim);
        return (ConstantClassInfo)cp.addConstant(ci);
    }
136504
final protected static function initializeMembers()
    {
        if (null === static::CONSTANCE_PATTERN) {
            foreach (get_defined_constants() as $key => $value) {
                new static($key, $value);
            }
        } else {
            foreach (get_defined_constants() as $key => $value) {
                if (preg_match(static::CONSTANCE_PATTERN, $key)) {
                    new static($key, $value);
                }
            }
        }
    }
962401
private void parseDefinition() {
        values = new ArrayList<DSLVariableValue>();
        if (getDefinition() == null) {
            return;
        }

        int variableStart = definition.indexOf("{");
        while (variableStart >= 0) {
            int variableEnd = getIndexForEndOfVariable(definition,
                                                       variableStart);
            String variable = definition.substring(variableStart + 1,
                                                   variableEnd);
            values.add(parseValue(variable));
            variableStart = definition.indexOf("{",
                                               variableEnd);
        }
    }