Bug #62967 [Opn]: 执行析构函数时工作目录有问题

From: Date: Wed, 29 Aug 2012 14:09:09 +0000
Subject: Bug #62967 [Opn]: 执行析构函数时工作目录有问题
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-173001@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=62967&edit=1 ID: 62967 Updated by: laruence@php.net 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设置的是? Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#173001) next »