#29167 [Com]: fopen works differently in a constructor vs. a destructor

From: Date: Mon, 30 Jul 2007 09:53:11 +0000
Subject: #29167 [Com]: fopen works differently in a constructor vs. a destructor
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-115554@lists.php.net to get a copy of this message
ID: 29167 Comment by: hans dot duedal at gmail dot com Reported By: kaspersv at privat dot dk Status: No Feedback Bug Type: Scripting Engine problem Operating System: * PHP Version: 5.0.0 Assigned To: helly New Comment: Upon closer examination, this bug is closely related to bug:34206, in which sniper@php.net states: "This really should be documented. Apache(1&2) does the weird cwd change for some reason." This obviously affect fopen calls, and although it did not seem like the problem at first, that is whats causing it. Calling destruct explicitly as wez@php.net suggested simply workaround bug:34206. I should also state that I am running "Apache/2.2.3 (Ubuntu) PHP/5.2.1" Previous Comments: ------------------------------------------------------------------------ [2007-07-30 09:32:56] hans dot duedal at gmail dot com As wez@php.net said, it's an shutdown order problem. Calling unset explicitly solves the problem, which also affects the unlink function. I was trying to create a destructor that would remove a temporary file. ------------------------------------------------------------------------ [2004-08-03 01:00:05] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". ------------------------------------------------------------------------ [2004-07-25 21:10:53] helly@php.net Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip ------------------------------------------------------------------------ [2004-07-15 18:25:27] wez@php.net Nothing to do with fopen, but instead the shutdown order; reclassifying. ------------------------------------------------------------------------ [2004-07-15 09:12:46] helly@php.net ATM you need to explicitly unset the object before script termination by using: unset($bugtest); ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/29167 -- Edit this bug report at http://bugs.php.net/?id=29167&edit=1

« previous php.bugs (#115554) next »