#30210 [Opn->Bgs]: Destructor resetting working-directory
| From: | helly@php.net | Date: | Thu, 23 Sep 2004 18:27:51 +0000 |
| Subject: | #30210 [Opn->Bgs]: Destructor resetting working-directory | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-66610@lists.php.net to get a copy of this message | ||
ID: 30210
Updated by: helly@php.net
Reported By: m dot leuffen at i-line dot net
-Status: Open
+Status: Bogus
Bug Type: Directory function related
Operating System: Linux
PHP Version: 5.0.1
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
The destructor is called during shutdown. If you require certain
behavior the unset() your object before the script terminates.
Previous Comments:
------------------------------------------------------------------------
[2004-09-23 16:31:11] m dot leuffen at i-line dot net
Description:
------------
Hi.
In __destruct() function the working-directory is default set to root
('/').
Bye,
Matthias
Reproduce code:
---------------
class Test {
public function __construct() {
echo "Constructor: ".getcwd();
}
public function __destruct() {
echo "\nDestructor: ".getcwd();
}
}
$obj = new Test();
Expected result:
----------------
Constructor: /home/xyz/dir
Destructor: /home/xyz/dir
Actual result:
--------------
Constructor: /home/xyz/dir
Destructor: /
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30210&edit=1