collection related function signature
The $collection
argument for csv_collection_to_file
should be an iterable
so that for instance results from an Traversable
object can also be used with the current functionnality.
In the same spirit I believe that the return type for csv_file_to_collection
should be either a Traversable
(maybe a Generator
) in case the content of the $file
parameter is big.
The trade-off for csv_file_to_collection
is that you will not be able to count the numbers of rows returned or applied dedicated array
functions on the returned value but you will gain a less memory intensive function which is always important when dealing with huge content.
For smaller content one can still use iterator_to_array
to convert the result into a proper array of arrays if really needed.