src/Analysis/Debugger.php
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);
    }
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);
    }
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 ) ; }
Return a backtrace array based on the supplied options.

@param array $options Format for outputting stack trace. Available options are:
- `'start'`: The depth to start with.
- `'depth'`: The maximum depth of the trace.
- `'message'`: Either `null` for default message or a string.
- `'trace'`: A trace to use instead of generating one.
@return array         The backtrace array.
Return a backtrace array based on the supplied options .