Library/SymbolTable.php
public function getTempVariableForObserve($type, CompilationContext $context)
    {
        $variable = $this->reuseTempVariable($type, 'observe');
        if (\is_object($variable)) {
            $variable->increaseUses();
            $variable->increaseMutates();
            $variable->observeVariant($context);

            return $variable;
        }

        $tempVar = $this->getNextTempVar();
        $variable = $this->addVariable($type, '_'.$tempVar, $context);
        $variable->setIsInitialized(true, $context);
        $variable->setTemporal(true);
        $variable->increaseUses();
        $variable->increaseMutates();
        $variable->observeVariant($context);

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

        return $variable;
    }
public function getTempVariableForObserve($type, CompilationContext $context)
    {
        $variable = $this->reuseTempVariable($type, 'observe');
        if (\is_object($variable)) {
            $variable->increaseUses();
            $variable->increaseMutates();
            $variable->observeVariant($context);

            return $variable;
        }

        $tempVar = $this->getNextTempVar();
        $variable = $this->addVariable($type, '_'.$tempVar, $context);
        $variable->setIsInitialized(true, $context);
        $variable->setTemporal(true);
        $variable->increaseUses();
        $variable->increaseMutates();
        $variable->observeVariant($context);

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

        return $variable;
    }
public function getTempVariableForObserve ( $ type , CompilationContext $ context ) { $ variable = $ this -> reuseTempVariable ( $ type , 'observe' ) ; if ( \ is_object ( $ variable ) ) { $ variable -> increaseUses ( ) ; $ variable -> increaseMutates ( ) ; $ variable -> observeVariant ( $ context ) ; return $ variable ; } $ tempVar = $ this -> getNextTempVar ( ) ; $ variable = $ this -> addVariable ( $ type , '_' . $ tempVar , $ context ) ; $ variable -> setIsInitialized ( true , $ context ) ; $ variable -> setTemporal ( true ) ; $ variable -> increaseUses ( ) ; $ variable -> increaseMutates ( ) ; $ variable -> observeVariant ( $ context ) ; $ this -> registerTempVariable ( $ type , 'observe' , $ variable ) ; return $ variable ; }
Creates a temporary variable to be used as intermediate variable of a read operation
Variables are automatically tracked by the memory manager.

@param string             $type
@param CompilationContext $context

@return Variable
Creates a temporary variable to be used as intermediate variable of a read operation Variables are automatically tracked by the memory manager .