|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2006-08-25 21:35 UTC] tony2001@php.net
  [2006-08-29 07:03 UTC] rr at d2g dot org dot uk
  [2006-08-29 10:08 UTC] tony2001@php.net
  [2006-08-29 12:04 UTC] rr at d2g dot org dot uk
  [2006-08-29 12:09 UTC] tony2001@php.net
  [2006-08-29 12:43 UTC] rr at d2g dot org dot uk
  [2006-12-31 21:23 UTC] iliaa@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 04:00:01 2025 UTC | 
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.