protected static function formatBacktrace(array $backtrace) : array
    {
        if (is_array($backtrace) === false || count($backtrace) === 0) {
            return $backtrace;
        }

        /**
         * Remove unnecessary info from backtrace
         */
        if ($backtrace[0]['function'] == '{closure}') {
            unset($backtrace[0]);
        }

        /**
         * Format backtrace
         */
        $trace = [];

        foreach ($backtrace as $entry) {

            /**
             * Function
             */
            $function = '';

            if (isset($entry['class'])) {
                $function .= $entry['class'] . $entry['type'];
            }

            $function .= $entry['function'] . '()';

            /**
             * Arguments
             */
            $arguments = [];

            if (isset($entry['args']) && count($entry['args']) > 0) {
                foreach ($entry['args'] as $arg) {
                    ob_start();

                    var_dump($arg);

                    $arg = htmlspecialchars(ob_get_contents());

                    ob_end_clean();

                    $arguments[] = $arg;
                }
            }

            /**
             * Location
             */
            $location = [];

            if (isset($entry['file'])) {
                $location['file'] = $entry['file'];
                $location['line'] = $entry['line'];
                $location['code'] = self::highlightCode($entry['file'], $entry['line']);
            }

            /**
             * Compile into array
             */
            $trace[] = array
            (
                'function'  => $function,
                'arguments' => $arguments,
                'location'  => $location,
            );
        }

        return $trace;
    }