Bug #73797 [NEW]: __DIR__ !== getcwd()

From: Date: Wed, 21 Dec 2016 03:32:27 +0000
Subject: Bug #73797 [NEW]: __DIR__ !== getcwd()
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-206170@lists.php.net to get a copy of this message
From: anrdaemon at freemail dot ru Operating system: Windows PHP version: 7.1.0 Package: Filesystem function related Bug Type: Bug Bug description:__DIR__ !== getcwd() Description: ------------ When running script from the current directory, you can't be sure if __DIR__ will match getcwd(), even if naive logic says they should be. Test script: --------------- mklink /J "%TEMP%\test.dir" "C:\Documents and Settings\Public\Desktop" cd "%TEMP%\test.dir" echo ^<^?php print __DIR__ . ^"\n^"; print getcwd() . ^"\n^"; > test.php C:\php\php.exe -f test.php Expected result: ---------------- I'm fully expecting equal output from both prints. Actual result: -------------- Actually, the output differs, as if __DIR__ is realpath()'d for some reason. -- Edit bug report at https://bugs.php.net/bug.php?id=73797&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73797&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73797&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73797&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=73797&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=73797&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=73797&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=73797&r=needscript Try newer version: https://bugs.php.net/fix.php?id=73797&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=73797&r=support Expected behavior: https://bugs.php.net/fix.php?id=73797&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=73797&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=73797&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=73797&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73797&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=73797&r=dst IIS Stability: https://bugs.php.net/fix.php?id=73797&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=73797&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=73797&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=73797&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=73797&r=mysqlcfg

« previous php.bugs (#206170) next »