#34206 [NEW]: cwd set to server root (?) in __destruct

From: Date: Sun, 21 Aug 2005 17:11:26 +0000
Subject: #34206 [NEW]: cwd set to server root (?) in __destruct
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-83855@lists.php.net to get a copy of this message
From: maniac_warlord at web dot de Operating system: Windows XP / Linux PHP version: 5.0.4 PHP Bug Type: Class/Object related Bug description: cwd set to server root (?) in __destruct Description: ------------ cwd is set to server root (i guess) instead of called php file's directory in __destruct() it probably isn't server root (see results), because that would be /www on linux - on windows it is Reproduce code: --------------- <?php class Foo { public function bar() { echo getcwd() . "\n"; } public function __destruct() { $this->bar(); } } $f = new Foo(); $f->bar(); ?> Expected result: ---------------- Windows XP: F:\htdocs F:\htdocs My webhoster's linux: /www/htdocs/[some number] /www/htdocs/[some number] (or whatever directory the file is in) Actual result: -------------- Windows XP: F:\htdocs D:\Apache\Apache 2 My webhoster's linux: /www/htdocs/[some number] / -- Edit bug report at http://bugs.php.net/?id=34206&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34206&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34206&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34206&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34206&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34206&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34206&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34206&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34206&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34206&r=support Expected behavior: http://bugs.php.net/fix.php?id=34206&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34206&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34206&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34206&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34206&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34206&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34206&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34206&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34206&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34206&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34206&r=mysqlcfg

« previous php.bugs (#83855) next »