PHPSA\Compiler\Expression\Variable::compile PHP Method

compile() protected method

$a
protected compile ( PhpParser\Node\Expr\Variable $expr, Context $context ) : CompiledExpression
$expr PhpParser\Node\Expr\Variable
$context PHPSA\Context
return PHPSA\CompiledExpression
    protected function compile($expr, Context $context)
    {
        $variable = $context->getSymbol($expr->name);
        if ($variable) {
            $variable->incGets();
            return new CompiledExpression($variable->getType(), $variable->getValue(), $variable);
        }
        $context->notice('undefined-variable', sprintf('You are trying to use an undefined variable $%s', $expr->name), $expr);
        return new CompiledExpression();
    }
Variable