go to bug id or search bugs for
As outlined in bug 38790 ( https://bugs.php.net/bug.php?id=38790 )
php do not keep the "context" information about the path.
The author of that comment being closed as "not a bug" was not very polite but
he was right about the report.
suppose a request to:
the web server know that is mapping to (for example) to
and should give that to php engine.
if, accidentally, "path" is a symbolic link then php should consider context.
In unix if you are in
and you do
you are sent back to /var/www/some
even if "path" is a symbolic link
that happen because the shell consider the context.
if php does not do that you can't use symlink reliably.
Consider that a feature request if you don't like "bug" :)
Even having an additional define like: __PSEUDO_DIR_PATH__ that doesn't solve
symlink may be enough to give the feature to an user but I think both __DIR__
and __FILE__ should NOT resolve symlinks
you can always use realpath() if you need to, but I understand that this can
introduce all sort of backward compatibility issue
Please re-consider your "not-a-bug" decision.
Add a Patch
Add a Pull Request
Duplicate of request #42516.