go to bug id or search bugs for
doesn't give the same result as
While the result of the second example is correct, the first one outputs only part of the value, in my case:
wwwroot is DOCUMENT_ROOT in my case.
I use NT4/IIS with PHP as ISAPI (not in safe mode).
Add a Patch
Add a Pull Request
RTFM. Realpath is for system paths, $PHP_SELF is relative to the web root.