Example #1
0
 function interpret(IContext $ctx)
 {
     $foo = $ctx->getFunction($this->name) ?: (isset(self::$list[$this->name]) ? self::$list[$this->name] : null);
     if (!$foo) {
         throw new FunctionNotFoundException("Function {$this->name} not found");
     }
     $values = array_map(function ($e) use($ctx) {
         $e->interpret($ctx);
         return $ctx->get($e);
     }, $this->arguments);
     $ctx->set($this, call_user_func_array($foo, $values));
 }