$fp_src=fopen('file','r');
$filter = stream_filter_prepend($fp_src, 'convert.iconv.ISO-8859-1/UTF-8');
while(fread($fp_src,4096)){
++$count;
if($count%1000==0) print ftell($fp_src)."\n";
}
When I run this the script ends up consuming ~ 200 MB of RAM after going through just 35MB of the file.
Running it without the stream_filter zips right through with a constant memory footprint of ~10 MB.
What gives?