a.php:: include "b.class.php";
Suppose that there is a relative path in the member method of b.class.php;
such as:./1.php __file__ and so on;
Will these relative paths be relative to the source file or relative to the a.php;
I use __file__ and./1.php test, unexpectedly is two kinds of effects, good chaos,
hereby ask; It is better to speak the principle in depth.
Reply to discussion (solution)
If you are in index.php include or require other files! Then the path in any other file is the path of index.php!
It can't be absolute!
__FILE__ is the location of the current file in the file system and is the absolute path. Not in the discussion of relative paths
The./1.php is a relative path, but the example you cite does not indicate the problem
If this a.php:: include "b/b.class.php";
So: this./1.php is relatively a.php, but/1.php does not exist and b/1.php exists, it is b/1.php.
Because b/1.php is also relative to b/b.php./1.php
This is a search order problem.