public function getBacktrace($exception = null)
    {
        $skipLimit = false;

        if ($exception instanceof \Exception || $exception instanceof \Throwable) {
            $backtrace = $exception->getTrace();
            foreach ($backtrace as $index => $backtraceCall) {
                unset($backtrace[$index]['args']);
            }
        } elseif (version_compare(PHP_VERSION, '5.4.0') >= 0) {
            $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, $this->backtraceLimit);
            $skipLimit = true;
        } else {
            $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
        }

        if ($this->backtraceLimit > 0 && !$skipLimit) {
            $backtrace = array_slice($backtrace, 0, $this->backtraceLimit);
        }

        return $backtrace;
    }