Where did I put that call?

2 September, 2006

Show comments

In the site update, this little tidbit went missing, so here it is again:

function pr($var) {
    if (DEBUG > 0) {

$array = debug_backtrace();
        echo(str_replace(ROOT, "", $array[0]['file'])." (line ".$array[0]['line'].")");

     echo "
        echo "
"; } }

With this minor change, you can see where your debug calls are being made, especially useful when you start seeing arrays on screen and can't figure out where they are coming from.