public function invokeFunction(string $function, array $arguments = [], bool $dependencyInjection = true)
    {
        try {
            // Reflection of function
            $reflectionFunction = new \ReflectionFunction($function);

            // Dependency injection?
            if ($dependencyInjection) {
                $arguments = $this->getDependencyInjectionParameters($reflectionFunction->getParameters(), $arguments);
            }
        } catch (\Exception $e) {
            throw new InstantiatorException(sprintf('Error during dependency injection of function "%s"', $function), 0, $e);
        }

        return $reflectionFunction->invokeArgs($arguments);
    }