2) Five minutes with a test script would tell you, and I bet google could tell you, so why bother the list with a question you could so easily answer for yourself? Go and try it and then report back where (if at all) it breaks. My bet is that you'l exhaust RAM and swap before you break php, especially if you actually store something -- like, say, 32 bytes of useless string output -- in each entry.
Indeed. The following script had my machine happily swapping like crazy at 320,000 array items (each being 1k, task manager showed 640meg total memory in use on this development machine with 512meg RAM running WinXP).
<?php while (@ob_end_flush()); $data = Array(); while (true) { $data[] = str_repeat('#', 1024); print count($data)."\n"; } ?>
To the OP, why do you need to store all the items in memory at the same time? Can't you read some, process them then read the next lot, process them, read the next lot.... etc?
-- Stuart
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php