It is possible to get the magic constant __FILE__ of a requirer script( the file that requires another ) inside the required file?
For example:
requirer.php
<?php
require 'pathtorequired/required.php';
required.php
<?php
echo __REQUIRER_FILE__; // => fullpathtorequirerfile/requirer.php
Note: they are not in same folder, the question is about the possibility of that feature without create a constant in requirer file.
About @MarkusZeller comment:
The suggestion is good, but choosing between have an absolute path constant in the requirer file or work with relative paths, i prefer the first option.