Edit report at http://bugs.php.net/bug.php?id=53906&edit=1
ID: 53906 Updated by: ka...@php.net Reported by: denisk at rg dot ru Summary: Problem at file creation in a class destructor -Status: Open +Status: Bogus Type: Bug Package: Class/Object related Operating System: Windows PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Thank you for taking the time to report a problem with PHP. Unfortunately you are not using a current version of PHP -- the problem might already be fixed. Please download a new PHP version from http://www.php.net/downloads.php If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PHP. Previous Comments: ------------------------------------------------------------------------ [2011-02-02 12:20:01] denisk at rg dot ru Description: ------------ PHP 5.3.3 or early There is no file creation if to specify a relative path in a class destructor. Test script: --------------- Not work. <?php class MyClass { public function __destruct() { file_put_contents('./filename.txt', 'text'); } } $Object = new MyClass(); ?> Actual result: -------------- It works: <?php class MyClass { public function __destruct() { file_put_contents('./filename.txt', 'text'); } } $Object = new MyClass(); unset($Object); ?> or <?php class MyClass { public function __destruct() { file_put_contents($_SERVER['DOCUMENT_ROOT']. '/filename.txt', 'text'); } } $Object = new MyClass(); ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=53906&edit=1