I just had the need for an Iterator that can sort itself by a user defined callback.
My special use case is that the DirectoryIterator of PHP does not sort the file list so it’s pretty random. But my program logic relies on files being sorted by filename.
Like what you read?
You can hire me or make a donation via PayPal!