Opened 3 years ago
Closed 3 years ago
#11749 closed defect (bug) (fixed)
recurse_dirsize() leaves directories open
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.0 |
| Component: | Multisite | Version: | 3.0 |
| Severity: | normal | Keywords: | has-patch |
| Cc: |
Description
shouldn't we close the dir handle before returning false?
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.

Nice question. I just wondered as well and since the PHP documnetation does offer both possiblities - automatically close with the garbage collector which can be a benefit for a functions local variables ( :) ) or not for some types (persistent database connections e.g.) I thought it's a good Idea to do some tests.
Stream Details
Testing Log
Suggestion
Since directory handles do not look like somehow limited there is no fear to run out of those. Since closing does actually does only produce overhead and not any benefit, it can be suggested to not close directory handles even if this sounds wired.
Testbed
PHP PHP Version 5.2.8; Windows NT 5.1 build 2600; Server API CGI/FastCGI. Used xdebug 2.0.0RC4-dev to gather memory and execution time.