I have a function, d(), in include/functions.php:
Code:
function d($var, $name="") {
   if ($name) $_SESSION['debug_statements'][$name] = $var;
   else $_SESSION['debug_statements'][] = $var;
}
In include/footer.php, I spit all of the statements out:
Code:
foreach ($_SESSION['debug_statements'] as $key => $value) {
   print "
      <h4>$key:</h4>
      <div style='padding-left: 15px;'><pre>
      "; 
   print_r($value); 
   print "
      </pre></div>
      ";

   }
My question is this: How do I display the correct __LINE__ and __FILE__ variables, to match where I have called d()?