Quick and Dirty Debug Function

In the last meeting we spoke of using something like
[code:1]print ('<pre>');print_r($valueToBeChecked);die;[/code:1]
to quickly debug apps
I took it a little further and created a function pr_debug();
[code:1]function pr_debug($value) {
$backtrace = debug_backtrace();
$file = isset($backtrace[0]['file'])?$backtrace[0]['file']:'???';
$line = isset($backtrace[0]['line'])?$backtrace[0]['line']:'???';
$function = isset($backtrace[0]['function'])?$backtrace[0]['function']:'???';
print '<pre>';
print "##>>\nDEBUG BREAKPOINT USING FUNCTION[<strong>$function</strong>]\nIN FILE[<strong>$file</strong>]\n@ LINE[<strong>$line</strong>]\n\n";
print "VALUE [<strong>";
print_r($value);
print "]</strong>\n\n";
print "BACK TRACE...\n";
print_r(debug_backtrace());
print '</pre>';
die;
}[/code:1]
This way in your code you can just do...
[code:1]pr_debug($valueToBeChecked);[/code:1]
And you get output similar to this which includes the file and line # the debug statment was at, and the stack(back), trace. ([i]not able to show HTML formatting in phpbb post[/i])

[code:1]DEBUG BREAKPOINT USING FUNCTION[pr_debug]
IN FILE[C:\apache2triad\htdocs\meyouwe\pages\content\home.php]
@ LINE[12]

VALUE [Array
(
[cachingEnabled] => 1
[pageIsSecure] =>
[tiles] => Array
(
[HEADER_DEFAULT] => tiles/common/header.default.tpl
[HEADER_SUB1_DEFAULT] => tiles/common/header.sub1.default.tpl
[FOOTER_DEFAULT] => C:/apache2triad/htdocs/meyouwe/templates/tiles/common/footer.st.pm.default.tpl
[ALPHA] => tiles/common/nav.sub.default.tpl
[BETA] => tiles/common/column.beta.tpl
[CONTENT_MAIN] => C:/apache2triad/htdocs/meyouwe/templates/tiles/comic/comic.home.tpl
[CONTENT_MAIN_SUB1] => tiles/common/nbsp.tpl
)
[values] => Array
(
[pageTitle] => codeElements
)
)
]
BACK TRACE...
Array
(
[0] => Array
(
[file] => C:\apache2triad\htdocs\meyouwe\pages\content\home.php
[line] => 12
[function] => pr_debug
)
[1] => Array
(
[file] => C:\apache2triad\htdocs\meyouwe\pages\comic\comic.home.php
[line] => 4
[args] => Array
(
[0] => C:\apache2triad\htdocs\meyouwe\pages\content\home.php
)
[function] => require_once
)
)[/code:1]

I wrote this in a hurry, so if anyone has additions or improvements, please post.