Lately when i was debugging some PHP file with XDebug (under Eclipse on Ubuntu) i came across a strange behaviour:
print(__FILE__);
resulted in
Not an answer, but you probably could use __DIR__ in php 5.3. UPD. Found that it often contains not what you expect it to.
__DIR__