Zephir\SymbolTable::getTempVariableForObserveOrNullify PHP Method

getTempVariableForObserveOrNullify() public method

Creates a temporary variable to be used as intermediate variable in a call operation Variables are automatically tracked by the memory manager
public getTempVariableForObserveOrNullify ( string $type, zephir\CompilationContext $context ) : Variable
$type string
$context zephir\CompilationContext
return Variable
    public function getTempVariableForObserveOrNullify($type, CompilationContext $context)
    {
        $variable = $this->reuseTempVariable($type, 'observe-nullify');
        if (is_object($variable)) {
            $variable->increaseUses();
            $variable->increaseMutates();
            $variable->observeOrNullifyVariant($context);
            return $variable;
        }
        $tempVar = $this->getNextTempVar();
        $variable = $this->addVariable($type, '_' . $tempVar, $context);
        $variable->setIsInitialized(true, $context, array());
        $variable->setTemporal(true);
        $variable->increaseUses();
        $variable->increaseMutates();
        $variable->observeOrNullifyVariant($context);
        $this->registerTempVariable($type, 'observe-nullify', $variable);
        return $variable;
    }