Zephir\Variable::initComplexLiteralVariant PHP Method

initComplexLiteralVariant() public method

Initializes a variant variable that is intended to have the special behavior of only freed its body value instead of the full variable
public initComplexLiteralVariant ( zephir\CompilationContext $compilationContext )
$compilationContext zephir\CompilationContext
    public function initComplexLiteralVariant(CompilationContext $compilationContext)
    {
        if ($this->numberSkips) {
            $this->numberSkips--;
            return;
        }
        if ($this->getName() != 'this_ptr' && $this->getName() != 'return_value') {
            if ($this->initBranch === false) {
                $this->initBranch = $compilationContext->currentBranch;
            }
            $compilationContext->headersManager->add('kernel/memory');
            if (!$this->isLocalOnly()) {
                $compilationContext->symbolTable->mustGrownStack(true);
                if ($this->variantInits > 0 || $compilationContext->insideCycle) {
                    $this->mustInitNull = true;
                    $compilationContext->codePrinter->output('ZEPHIR_INIT_LNVAR(' . $this->getName() . ');');
                } else {
                    $compilationContext->backend->initVar($this, $compilationContext);
                }
            } else {
                if ($this->variantInits > 0 || $compilationContext->insideCycle) {
                    $this->mustInitNull = true;
                    $compilationContext->codePrinter->output('ZEPHIR_SINIT_LNVAR(' . $this->getName() . ');');
                } else {
                    $compilationContext->codePrinter->output('ZEPHIR_SINIT_VAR(' . $this->getName() . ');');
                }
            }
            $this->variantInits++;
        }
    }