ID: 38591 Updated by: [EMAIL PROTECTED] Reported By: rr at d2g dot org dot uk -Status: Open +Status: Feedback Bug Type: *Directory/Filesystem functions Operating System: win XP PHP Version: 5.1.5 New Comment:
What do you mean by "memory leak" ? Previous Comments: ------------------------------------------------------------------------ [2006-08-29 07:03:59] rr at d2g dot org dot uk Still present when using CSV snapshot. ------------------------------------------------------------------------ [2006-08-25 21:35:42] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.2-win32-latest.zip ------------------------------------------------------------------------ [2006-08-25 15:19:24] rr at d2g dot org dot uk Description: ------------ When running the code below on PHP version 5.1.6. On what seems to be any directory with files in, have tested with my C:/ and C:/folder/. The code below is run from the Command Line to recreate the issue. This is only present when using __toString rather than ->getFileName() or ->getPathName functions of DirectoryIterator. A memory leak occours. Reproduce code: --------------- <?php set_time_limit(0); while(true) { $CurrentDir = new DirectoryIterator("C:/"); foreach($CurrentDir as $file) { $tmp = pathinfo($file); print_r($tmp); } unset($tmp); unset($file); unset($CurrentDir); sleep(1); } ?> Expected result: ---------------- Works. Actual result: -------------- Works, but has memory Leak. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38591&edit=1