Zephir\SymbolTable::addTemp PHP Method

addTemp() public method

Creates a temporary variable
public addTemp ( string $type, zephir\CompilationContext $context ) : Variable
$type string
$context zephir\CompilationContext
return Variable
    public function addTemp($type, CompilationContext $context)
    {
        /*$variable = $this->reuseTempVariable($type, 'heap');
          if (is_object($variable)) {
              $variable->increaseUses();
              $variable->increaseMutates();
              return $variable;
          }*/
        $tempVar = $this->getNextTempVar();
        $variable = $this->addVariable($type, '_' . $tempVar, $context);
        $variable->setIsInitialized(true, $context, array());
        $variable->setTemporal(true);
        $variable->increaseUses();
        $variable->increaseMutates();
        //$this->registerTempVariable($type, 'heap', $variable);
        return $variable;
    }