#38591 [Fbk->Opn]: Memory Leak when using pathinfo and DirectoryIterator __toString
| From: | rr at d2g dot org dot uk | Date: | Tue, 29 Aug 2006 07:03:59 +0000 |
| Subject: | #38591 [Fbk->Opn]: Memory Leak when using pathinfo and DirectoryIterator __toString | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-101470@lists.php.net to get a copy of this message | ||
ID: 38591
User updated by: rr at d2g dot org dot uk
Reported By: rr at d2g dot org dot uk
-Status: Feedback
+Status: Open
Bug Type: *Directory/Filesystem functions
Operating System: win XP
PHP Version: 5.1.5
New Comment:
Still present when using CSV snapshot.
Previous Comments:
------------------------------------------------------------------------
[2006-08-25 21:35:42] tony2001@php.net
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