Edit report at https://bugs.php.net/bug.php?id=62967&edit=1

 ID:                 62967
 User updated by:    360586201 at qq dot com
 Reported by:        360586201 at qq dot com
 Summary:            执行析构函数时工作目录有问题
 Status:             Open
 Type:               Bug
 Package:            *Directory/Filesystem functions
 PHP Version:        5.3.16
 Block user comment: N
 Private report:     N

 New Comment:

DocumentRoot "D:/www/"


Previous Comments:
------------------------------------------------------------------------
[2012-08-29 14:09:09] [email protected]

你的DocumentRoot设置的是?

------------------------------------------------------------------------
[2012-08-29 13:25:57] 360586201 at qq dot com

Description:
------------
在析构函数的当前工作目录竟然变为了apache目录

更奇怪的是,我不执行普通方法时,析构函数的工作目录是正确的,也是代码的执行目录,当我执行过普
通方法后,就一直为apache目录了


Test script:
---------------
<?php
class get_path {
        function __construct() {
                //获取当前工作路径
                echo getcwd().'<br>';  #输出 D:\www\test(代码执行目录)
        }

        function write() {
                //获取当前工作路径
                echo getcwd().'<br>';  #输出 D:\www\test(代码执行目录)
        }

        function __destruct() {
                //获取当前工作路径
                echo getcwd();  #输出 D:\Program 
Files\wamp\bin\apache\Apache2.2.21(apache目录)
        }
}

$gl = new get_path();
$gl->write();



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=62967&edit=1

Reply via email to