fuel/fuel/core/classes/debug.php
public static function backtrace($trace = null)
	{
		$trace or $trace = debug_backtrace();

		if (\Fuel::$is_cli) {
			// Special case for CLI since the var_dump of a backtrace is of little use.
			$str = '';
			foreach ($trace as $i => $frame)
			{
				$line = "#$i\t";

				if ( ! isset($frame['file']))
				{
					$line .= "[internal function]";
				}
				else
				{
					$line .= $frame['file'] . ":" . $frame['line'];
				}

				$line .= "\t";

				if (isset($frame['function']))
				{
					if (isset($frame['class']))
					{
						$line .= $frame['class'] . '::';
					}

					$line .= $frame['function'] . "()";
				}

				$str .= $line . "\n";

			}

			return $str;
		}
		else
		{
			return static::dump($trace);
		}
	}
public static function backtrace($trace = null)
	{
		$trace or $trace = debug_backtrace();

		if (\Fuel::$is_cli) {
			// Special case for CLI since the var_dump of a backtrace is of little use.
			$str = '';
			foreach ($trace as $i => $frame)
			{
				$line = "#$i\t";

				if ( ! isset($frame['file']))
				{
					$line .= "[internal function]";
				}
				else
				{
					$line .= $frame['file'] . ":" . $frame['line'];
				}

				$line .= "\t";

				if (isset($frame['function']))
				{
					if (isset($frame['class']))
					{
						$line .= $frame['class'] . '::';
					}

					$line .= $frame['function'] . "()";
				}

				$str .= $line . "\n";

			}

			return $str;
		}
		else
		{
			return static::dump($trace);
		}
	}
public static function backtrace ( $ trace = null ) { $ trace or $ trace = debug_backtrace ( ) ; if ( \ Fuel :: $ is_cli ) { // Special case for CLI since the var_dump of a backtrace is of little use. $ str = '' ; foreach ( $ trace as $ i => $ frame ) { $ line = "#$i\t" ; if ( ! isset ( $ frame [ 'file' ] ) ) { $ line .= "[internal function]" ; } else { $ line .= $ frame [ 'file' ] . ":" . $ frame [ 'line' ] ; } $ line .= "\t" ; if ( isset ( $ frame [ 'function' ] ) ) { if ( isset ( $ frame [ 'class' ] ) ) { $ line .= $ frame [ 'class' ] . '::' ; } $ line .= $ frame [ 'function' ] . "()" ; } $ str .= $ line . "\n" ; } return $ str ; } else { return static :: dump ( $ trace ) ; } }
Output the call stack from here, or the supplied one.

@param	array		(optional) A backtrace to output
@return  string		Formatted backtrace
Output the call stack from here or the supplied one .