Library/SymbolTable.php
public function getVariable($name, $compilationContext = null)
    {
        /* Check if the variable already is referencing a branch */
        $pos = strpos($name, Variable::BRANCH_MAGIC);
        if ($pos > -1) {
            $branchId = (int) (substr($name, $pos + \strlen(Variable::BRANCH_MAGIC)));
            $name = substr($name, 0, $pos);
        } else {
            $branch = $this->resolveVariableToBranch($name, $compilationContext ?: $this->compilationContext);
            if (!$branch) {
                return false;
            }
            $branchId = $branch->getUniqueId();
        }
        if (!isset($this->branchVariables[$branchId]) || !isset($this->branchVariables[$branchId][$name])) {
            return false;
        }

        return $this->branchVariables[$branchId][$name];
    }
public function getVariable($name, $compilationContext = null)
    {
        /* Check if the variable already is referencing a branch */
        $pos = strpos($name, Variable::BRANCH_MAGIC);
        if ($pos > -1) {
            $branchId = (int) (substr($name, $pos + \strlen(Variable::BRANCH_MAGIC)));
            $name = substr($name, 0, $pos);
        } else {
            $branch = $this->resolveVariableToBranch($name, $compilationContext ?: $this->compilationContext);
            if (!$branch) {
                return false;
            }
            $branchId = $branch->getUniqueId();
        }
        if (!isset($this->branchVariables[$branchId]) || !isset($this->branchVariables[$branchId][$name])) {
            return false;
        }

        return $this->branchVariables[$branchId][$name];
    }
public function getVariable ( $ name , $ compilationContext = null ) { /* Check if the variable already is referencing a branch */ $ pos = strpos ( $ name , Variable :: BRANCH_MAGIC ) ; if ( $ pos > - 1 ) { $ branchId = ( int ) ( substr ( $ name , $ pos + \ strlen ( Variable :: BRANCH_MAGIC ) ) ) ; $ name = substr ( $ name , 0 , $ pos ) ; } else { $ branch = $ this -> resolveVariableToBranch ( $ name , $ compilationContext ? : $ this -> compilationContext ) ; if ( ! $ branch ) { return false ; } $ branchId = $ branch -> getUniqueId ( ) ; } if ( ! isset ( $ this -> branchVariables [ $ branchId ] ) || ! isset ( $ this -> branchVariables [ $ branchId ] [ $ name ] ) ) { return false ; } return $ this -> branchVariables [ $ branchId ] [ $ name ] ; }
Returns a variable in the symbol table.

@param $name
@param CompilationContext $compilationContext

@return bool|\Zephir\Variable
Returns a variable in the symbol table .