public function callFunction($name, Template $template = null, $arguments = [])
    {
        $callable = $this->getFunction($name);

        if (\is_array($callable) &&
            isset($callable[0]) &&
            $callable[0] instanceof ExtensionInterface
        ) {
            $callable[0]->template = $template;
        }

        return $callable(...$arguments);
    }