Library/SymbolTable.php
public function getTempVariableForWrite($type, CompilationContext $context, $init = true)
    {
        $variable = $this->reuseTempVariable($type, 'heap');
        if (\is_object($variable)) {
            $variable->increaseUses();
            $variable->increaseMutates();
            if ($init && ('variable' == $type || 'string' == $type || 'array' == $type)) {
                $variable->initVariant($context);
            }

            return $variable;
        }

        $tempVar = $this->getNextTempVar();
        $variable = $this->addVariable($type, '_'.$tempVar, $context);
        $variable->setIsInitialized(true, $context);
        $variable->setTemporal(true);
        $variable->increaseUses();
        $variable->increaseMutates();
        if ('variable' == $type || 'string' == $type || 'array' == $type) {
            $variable->initVariant($context);
        }

        $this->registerTempVariable($type, 'heap', $variable);

        return $variable;
    }
public function getTempVariableForWrite($type, CompilationContext $context, $init = true)
    {
        $variable = $this->reuseTempVariable($type, 'heap');
        if (\is_object($variable)) {
            $variable->increaseUses();
            $variable->increaseMutates();
            if ($init && ('variable' == $type || 'string' == $type || 'array' == $type)) {
                $variable->initVariant($context);
            }

            return $variable;
        }

        $tempVar = $this->getNextTempVar();
        $variable = $this->addVariable($type, '_'.$tempVar, $context);
        $variable->setIsInitialized(true, $context);
        $variable->setTemporal(true);
        $variable->increaseUses();
        $variable->increaseMutates();
        if ('variable' == $type || 'string' == $type || 'array' == $type) {
            $variable->initVariant($context);
        }

        $this->registerTempVariable($type, 'heap', $variable);

        return $variable;
    }
public function getTempVariableForWrite ( $ type , CompilationContext $ context , $ init = true ) { $ variable = $ this -> reuseTempVariable ( $ type , 'heap' ) ; if ( \ is_object ( $ variable ) ) { $ variable -> increaseUses ( ) ; $ variable -> increaseMutates ( ) ; if ( $ init && ( 'variable' == $ type || 'string' == $ type || 'array' == $ type ) ) { $ variable -> initVariant ( $ context ) ; } return $ variable ; } $ tempVar = $ this -> getNextTempVar ( ) ; $ variable = $ this -> addVariable ( $ type , '_' . $ tempVar , $ context ) ; $ variable -> setIsInitialized ( true , $ context ) ; $ variable -> setTemporal ( true ) ; $ variable -> increaseUses ( ) ; $ variable -> increaseMutates ( ) ; if ( 'variable' == $ type || 'string' == $ type || 'array' == $ type ) { $ variable -> initVariant ( $ context ) ; } $ this -> registerTempVariable ( $ type , 'heap' , $ variable ) ; return $ variable ; }
Creates a temporary variable to be used in a write operation.

@param string             $type
@param CompilationContext $context
@param mixed              $init

@return Variable
Creates a temporary variable to be used in a write operation .