PHP 4.0 Bug #7642: working directory not maintained in registered shutdown function

From: Date: Sun, 05 Nov 2000 03:46:12 +0000
Subject: PHP 4.0 Bug #7642: working directory not maintained in registered shutdown function
Groups: php.dev 
Request: Send a blank email to php-dev+get-37150@lists.php.net to get a copy of this message
From: kjackson@gpu.srv.ualberta.ca Operating system: Linux PHP version: 4.0.3pl1 PHP Bug Type: Unknown/Other Function Bug description: working directory not maintained in registered shutdown function Fox example, the current script is "/dir1/dir2/test.php"... register_shutdown_function("shutDown"); $cwd = getcwd(); function shutDown() { global $cwd; $fp = fopen("/dir1/dir2/temp.txt", "w"); fwrite($fp, $cwd."\n".getcwd()); fclose($fp); } Run it and view "temp.txt". You will find that the current working directory changes from "/dir1/dir2/" to "/". This was not the case in php 3.0.8, and I presume to be a bug. -- Edit Bug report at: http://bugs.php.net/?id=7642&edit=1

« previous php.dev (#37150) next »