title: Is it possible to get the magic constants of the caller context in php?
body: <p>I'd like to create a debug function that dumps information about the execution context along with some other info.</p>
  
  <p>In debug.php I have a function that dumps whatever is passed as a parameter. I'm interested in a way of calling the dump function from, say example.php and have it return the file name, the line number and the function name of the calling context.</p>
  
  <pre><code>1. &lt;?php
  2. function my_function(){
  3.   $var = 'My example';
  4.   dump( $var );
  5. }
  6. ?&gt;
  </code></pre>
  
  <p><em>example.php</em></p>
  
  <p>I'd like for the above function to output: "example.php, my_function, 4: My example".</p>
  
  <p>Is there anyway of doing this (short of passing <code>__FILE__</code>, <code>__FUNCTION__</code>, and <code>__LINE__</code>) as parameters?</p>