The main question is why an include file needs to know which
file included it.
If you´d read the whole thing, you´d know OR I totally failed explaining
in short-style.
a) If you distribute PHP-apps to users, which absolutely do not know
what PHP or even a sss-lanuage is, it´ll be better to let them include
<?php include('php.app.php'); ?>
instead of
<?php $foobar=__FILE__; include('php.app.php'); ?>
so that they think they plugged in a component.
b) If you meant it the other way round, what should I do with that
information, well, if the included files do the whole processing
and you need to generate forms and links pointing to the *same*
app, you cannot use __FILE__ because it is useless. You have
to use $foobar, which must be included in the code the user needs
to include.
Eg. when the compiler is available, you can create applications that
a) are configurable with a config script, maybe a normal .php file
b) you´ve the compiled application you include with include()
c) you´ve just <?php include('php.app.php'); ?> this code, and the
user can´t do *anything* wrong instead of passing the wrong filename,
but that he´ll fix very fast.
I would be practical.