getValue() public method

Returns the value of the expression.
public getValue ( ) : mixed
return mixed
Esempio n. 1
0
File: Assign.php Progetto: ovr/phpsa
 protected function compileVariableDeclaration(CompiledExpression $variableName, CompiledExpression $value, Context $context)
 {
     switch ($variableName->getType()) {
         case CompiledExpression::STRING:
             break;
         default:
             $context->debug('Unexpected type of Variable name after compile');
             return new CompiledExpression();
     }
     $symbol = $context->getSymbol($variableName->getValue());
     if ($symbol) {
         $symbol->modify($value->getType(), $value->getValue());
         $context->modifyReferencedVariables($symbol, $value->getType(), $value->getValue());
     } else {
         $symbol = new \PHPSA\Variable($variableName->getValue(), $value->getValue(), $value->getType(), $context->getCurrentBranch());
         $context->addVariable($symbol);
     }
     $symbol->incSets();
 }