Get the __FILE__ constant for a function's caller in PHP
<p>I know the <code>__FILE__</code> magic constant in PHP will turn into the full path and filename of the currently executing file. But is there a way I can get the same information for a function's calling file? For example:</p>

<pre><code>//foo.php:
include "bar.php";
call_it();

//bar.php
function call_it() {
    echo "Calling file: ".__CALLING_FILE__;
}
</code></pre>

<p>which would output <code>Calling file: ....../foo.php</code>.</p>

<p>I know there's no <code>__CALLING_FILE__</code> magic constant, or a magic constant to handle this, but is there a way I can get that information? The least-hackish solution would be ideal (eg. using a stack trace would be pretty hacky) but in the end I just need it to work.</p>
