ID: 30267 Updated by: [EMAIL PROTECTED] Reported By: eiriksletteberg at hotmail dot com -Status: Feedback +Status: No Feedback Bug Type: Zend Engine 2 problem Operating System: Windows 98SE PHP Version: 5.0.1 New Comment:
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". Previous Comments: ------------------------------------------------------------------------ [2004-09-30 03:34:43] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.0-win32-latest.zip Cannot replicate on either windows or linux. ------------------------------------------------------------------------ [2004-09-30 00:48:41] htmldoug at msn dot com Reproduction code run using PHP 5.0.2 under WinXP executes exactly as expected. ------------------------------------------------------------------------ [2004-09-28 21:31:16] eiriksletteberg at hotmail dot com Description: ------------ When this code is executed, one would expect data.txt to contain "Hello World!". And, as file_get_contents() says, it is. But when the script is completely executed, data.txt does not contain "Hello World!" as it should. The error does not occur if the destructor is called before the script ends, eg. by unset()'ing $foo. Seems like the destructor cannot write to files when called at the end of scripts?!? Reproduce code: --------------- <?php class data { function __destruct() { $data = "Hello World!"; // Show that the destructor is called print "Destructor called."; $link = fopen("data.txt", 'w'); fwrite($link, $data); fclose($link); // Check if we have written it print "Contents: ".file_get_contents("data.txt"); } } $foo = new data; ?> Expected result: ---------------- data.txt should contain "Hello World!" Actual result: -------------- data.txt is empty or contains the previous value ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30267&edit=1