Hide
on 2/9/06

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

  1. <?php
  2. function pr($var) {
  3. if (DEBUG > 0) {
  4. $array = debug_backtrace();
  5. echo(str_replace(ROOT, "", $array[0]['file'])." (line ".$array[0]['line'].")");
  6. echo "<pre>";
  7. print_r($var);
  8. echo "</pre>";
  9. }
  10. }
  11. ?>

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.

0 Responses to Where did I put that call?