Storing clones of SplFileInfo objects in an array to sort them, throws the following error:
[SOLUTION]failed to open dir: Too many open files in [...]
If only I had seen Ken Snyder's comment on PHP DirectoryIterator's documentation page before:
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).