Zephir\Variable::observeOrNullifyVariant PHP Method

observeOrNullifyVariant() public method

Observes a variable in the memory frame without initialization or nullify an existing allocated variable
public observeOrNullifyVariant ( zephir\CompilationContext $compilationContext )
$compilationContext zephir\CompilationContext
    public function observeOrNullifyVariant(CompilationContext $compilationContext)
    {
        if ($this->numberSkips) {
            $this->numberSkips--;
            return;
        }
        $name = $this->getName();
        if ($name != 'this_ptr' && $name != 'return_value') {
            if ($this->initBranch === false) {
                $this->initBranch = $compilationContext->currentBranch;
            }
            $compilationContext->headersManager->add('kernel/memory');
            $compilationContext->symbolTable->mustGrownStack(true);
            if ($this->variantInits > 0 || $compilationContext->insideCycle) {
                $this->mustInitNull = true;
                //$compilationContext->codePrinter->output('ZEPHIR_OBS_NVAR(' . $this->getName() . ');');
            } else {
                //$compilationContext->codePrinter->output('ZEPHIR_OBS_VAR(' . $this->getName() . ');');
            }
            $this->variantInits++;
            $this->setMustInitNull(true);
        }
    }