<p>I can currently to the following:</p>

<pre><code>class SubClass extends SuperClass {
  function __construct() {
    parent::__construct();
  }
}

class SuperClass {
  function __construct() {
    // this echoes "I'm SubClass and I'm extending SuperClass"
    echo 'I\'m '.get_class($this).' and I\'m extending '.__CLASS__;
  }
}
</code></pre>

<p>I would like to do something similar with the filenames (<code>__FILE__</code>, but dynamically evaluated); I would like to know what file the subclass resides in, from the superclass. Is it possible in any elegant way?</p>

<p>I know you could do something with <a href="http://fi.php.net/get_included_files" rel="nofollow noreferrer"><code>get_included_files()</code></a>, but that's not very efficient, especially if I have numerous instances.</p>

Uh, not really, that I can think of.  Each subclass would need to have an explicitly implemented method that returned
```
__FILE__
```
, which completely defeats the point of inheritance in the first place.
I'm also really curious as to why something like this would be useful.