Let's pretend I have a symbolic link pointing to /some/fake/location
from /some/real/location
In that hypothetical directory I have a file named blah.php
which reads:
#!/usr/bin/php
<?php echo __dir__; ?>
I then execute blah.php
from the command line like so:
php /some/fake/location/blah.php
The output is
/some/real/location
How do I get the current PHP file's directory without resolving any symbolic links?