From: bugs dot php dot net at callum-macdonald dot com Operating system: Linux PHP version: 5.2.6 PHP Bug Type: Feature/Change Request Bug description: __FILE__ should not resolve symlink paths
Description: ------------ See these bugs: http://bugs.php.net/bug.php?id=38790 http://bugs.php.net/bug.php?id=42516 http://bugs.php.net/bug.php?id=37603 The __FILE__ constant should not, in my opinion, resolve symbolic links on *nix operating systems. At the very least, there should be an option to control this behaviour. Because __FILE__ returns only the symlink resolved path, there is no way to get the symlink path of the currently included file. If __FILE__ returned the symlinkpath, the resolved path could be retrieved with realpath(__FILE__). The opposite is not true. There is no way to go from the resolved path to the original link path. I realise this is a feature not a bug, but I believe it is a serious shortcoming and limits the ability of PHP in symlinked situations. Reproduce code: --------------- See http://bugs.php.net/bug.php?id=37603 Expected result: ---------------- __FILE__ should return the symlink path Actual result: -------------- __FILE__ returns the resolved path -- Edit bug report at http://bugs.php.net/?id=46260&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46260&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46260&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46260&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=46260&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=46260&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=46260&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=46260&r=needscript Try newer version: http://bugs.php.net/fix.php?id=46260&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=46260&r=support Expected behavior: http://bugs.php.net/fix.php?id=46260&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=46260&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=46260&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=46260&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46260&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=46260&r=dst IIS Stability: http://bugs.php.net/fix.php?id=46260&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=46260&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=46260&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=46260&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=46260&r=mysqlcfg
