public static function backtrace($options = [])
    {
        $defaults = [
            'trace'  => [],
            'start'  => 0,
            'depth'  => 0,
            'object' => false,
            'args'   => false
        ];
        $options += $defaults;

        $mask = $options['args'] ? 0 : DEBUG_BACKTRACE_IGNORE_ARGS;
        $mask = $options['object'] ? $mask | DEBUG_BACKTRACE_PROVIDE_OBJECT : $mask;

        $backtrace = static::normalize($options['trace'] ?: debug_backtrace($mask));

        $traceDefaults = [
            'line'     => '?',
            'file'     => '[internal]',
            'class'    => null,
            'function' => '[NA]'
        ];

        $back = [];
        $ignoreFunctions = ['call_user_func_array', 'trigger_error'];

        foreach ($backtrace as $i => $trace) {
            $trace += $traceDefaults;
            if (strpos($trace['function'], 'Closure$') === 0 ||
                strpos($trace['function'], '{closure}') !== false ||
                in_array($trace['function'], $ignoreFunctions)) {
                continue;
            }
            $back[] = $trace;
        }

        $count = count($back);
        return array_splice($back, $options['start'], $options['depth'] ?: $count);
    }