Voting

: five plus four?
(Example: nine)

The Note You're Voting On

kendsnyder at gmail dot com
16 years ago
Don't store DirectoryIterator objects for later; you will get an error saying "too many open files" when you store more than the operating system limit (usually 256 or 1024).

For example, this will yield an error if the directory has too many files:

<?php
$files
= array();
foreach (new
DirectoryIterator('myDir') as $file) {
$files[] = $file;
}
?>

Presumably, this approach is memory intensive as well.

<< Back to user notes page

To Top