"; $ret .= "".htmlspecialchars(trim($code[$backtrace[0]['line']-1]))."\n"; $ret .= "\n"; ob_start(); foreach ($args as $arg) var_dump($arg); var_dump($_SERVER); var_dump($_COOKIE); $str = ob_get_contents(); ob_end_clean(); $str = preg_replace('/=>(\s+)/', ' => ', $str); $str = preg_replace('/ => NULL/', ' → NULL', $str); $str = preg_replace('/}\n(\s+)\[/', "}\n\n".'$1[', $str); $str = preg_replace('/ (float|int)\((\-?[\d\.]+)\)/', " $1 $2", $str); $str = preg_replace('/array\((\d+)\) {\s+}\n/', "array•$1 []", $str); $str = preg_replace('/ string\((\d+)\) \"(.*)\"/', " str•$1 '$2'", $str); $str = preg_replace('/\[\"(.+)\"\] => /', "'$1' → ", $str); $str = preg_replace('/object\((\S+)\)#(\d+) \((\d+)\) {/', "obj•$2 $1[$3] {", $str); $str = str_replace("bool(false)", "bool•false", $str); $str = str_replace("bool(true)", "bool•true", $str); $ret .= $str; $ret .= ""; return $ret; } // Original - http://www.php.net/manual/en/function.debug-print-backtrace.php#86932 function debug_string_backtrace() { ob_start(); debug_print_backtrace(); $trace = ob_get_contents(); ob_end_clean(); // Remove first item from backtrace as it's this function which // is redundant. $trace = preg_replace ('/^#0\s+' . __FUNCTION__ . "[^\n]*\n/", '', $trace, 1); // Renumber backtrace items. $trace = preg_replace ('/^#(\d+)/me', '\'#\' . ($1 - 1)', $trace); $trace = wordwrap($trace, 123, "
"); return $trace; }