public static function debugBacktraceString($trace = null) {
		$result = [];
		if (!\Debug::$debug) return $result;
		$i = 1;
		// if trace is not provided
		if (empty($trace)) {
			$trace = debug_backtrace();
			unset($trace[0]);
		}
		foreach($trace as $v) {
			$stack = '#' . $i . ' ' . (isset($v['file']) ? $v['file'] : 'Unknown');
			if (isset($v['line'])) {
				$stack.= '(' . $v['line'] . ')';
			}
			// do not show error handler
			if (!(isset($v['class']) && $v['class'] == 'error' && $v['function'] == 'error_handler')) {
				$stack.= ': ';
				if(isset($v['class'])) {
					$stack.= $v['class'] . $v['type'];
				}
				$params = [];
				if (isset($v['args'])) {
					foreach ($v['args'] as $v2) {
						if (gettype($v2) == 'string') {
							$params[] = str_replace(["\n", "\r", "\t"], ' ', $v2);
						} else if (is_array($v2)) {
							$temp = var_export_condensed($v2, ['skip_objects' => true]);
							$params[] = substr($temp, 0, 100) . '...';
						} else {
							$params[] = var_export_condensed($v2, ['skip_objects' => true]);
						}
					}
				}
				$stack.= $v['function'] . '(' . implode(', ', $params) . ');';
			}
			$i++;
			$result[] = $stack;
		}
		return $result;
	}
public static function debugBacktraceString($trace = null) {
		$result = [];
		if (!\Debug::$debug) return $result;
		$i = 1;
		// if trace is not provided
		if (empty($trace)) {
			$trace = debug_backtrace();
			unset($trace[0]);
		}
		foreach($trace as $v) {
			$stack = '#' . $i . ' ' . (isset($v['file']) ? $v['file'] : 'Unknown');
			if (isset($v['line'])) {
				$stack.= '(' . $v['line'] . ')';
			}
			// do not show error handler
			if (!(isset($v['class']) && $v['class'] == 'error' && $v['function'] == 'error_handler')) {
				$stack.= ': ';
				if(isset($v['class'])) {
					$stack.= $v['class'] . $v['type'];
				}
				$params = [];
				if (isset($v['args'])) {
					foreach ($v['args'] as $v2) {
						if (gettype($v2) == 'string') {
							$params[] = str_replace(["\n", "\r", "\t"], ' ', $v2);
						} else if (is_array($v2)) {
							$temp = var_export_condensed($v2, ['skip_objects' => true]);
							$params[] = substr($temp, 0, 100) . '...';
						} else {
							$params[] = var_export_condensed($v2, ['skip_objects' => true]);
						}
					}
				}
				$stack.= $v['function'] . '(' . implode(', ', $params) . ');';
			}
			$i++;
			$result[] = $stack;
		}
		return $result;
	}
public static function debugBacktraceString ( $ trace = null ) { $ result = [ ] ; if ( ! \ Debug :: $ debug ) return $ result ; $ i = 1 ; // if trace is not provided if ( empty ( $ trace ) ) { $ trace = debug_backtrace ( ) ; unset ( $ trace [ 0 ] ) ; } foreach ( $ trace as $ v ) { $ stack = '#' . $ i . ' ' . ( isset ( $ v [ 'file' ] ) ? $ v [ 'file' ] : 'Unknown' ) ; if ( isset ( $ v [ 'line' ] ) ) { $ stack .= '(' . $ v [ 'line' ] . ')' ; } // do not show error handler if ( ! ( isset ( $ v [ 'class' ] ) && $ v [ 'class' ] == 'error' && $ v [ 'function' ] == 'error_handler' ) ) { $ stack .= ': ' ; if ( isset ( $ v [ 'class' ] ) ) { $ stack .= $ v [ 'class' ] . $ v [ 'type' ] ; } $ params = [ ] ; if ( isset ( $ v [ 'args' ] ) ) { foreach ( $ v [ 'args' ] as $ v2 ) { if ( gettype ( $ v2 ) == 'string' ) { $ params [ ] = str_replace ( [ "\n" , "\r" , "\t" ] , ' ' , $ v2 ) ; } else if ( is_array ( $ v2 ) ) { $ temp = var_export_condensed ( $ v2 , [ 'skip_objects' => true ] ) ; $ params [ ] = substr ( $ temp , 0 , 100 ) . '...' ; } else { $ params [ ] = var_export_condensed ( $ v2 , [ 'skip_objects' => true ] ) ; } } } $ stack .= $ v [ 'function' ] . '(' . implode ( ', ' , $ params ) . ');' ; } $ i ++ ; $ result [ ] = $ stack ; } return $ result ; }
Format debug trace

@param array $trace
@return array
Format debug trace