while (!feof($handle)) { fread($handle, 8192); }
I'm ignoring the data returned by fread, since I'm just interested in how long that loop takes, not the contents. It works fine on small files, but once the test file is above PHP's memory limit I get "Allowed memory size of 8388608 bytes exhausted (tried to allocate 8192 bytes)".
What I can't figure out is why memory is getting allocated in that loop.
I've also tried doing $string = fread (...) and immediately following that with unset($string) or $string = NULL or $string = ''. None of those worked, I still run out of memory.
Any suggestions?
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php