I've asked similar questions a couple times over the past month or so with no conclusive answer.
I need to write a script that knows what the original script being executed is (when it's included). No matter how many layers of nested includes there are, it needs to find the page at the 'top.'
It seems that the array returned by get_included_files always has this as element 0. I haven't been able to find a definite answer as to whether or not this is reliable. It doesn't need to be valid cross-server, so long as it works on PHP 4.4.0 running under apache.