On 07/27/2012 11:59 PM, Lester Caine wrote:
> Rasmus Lerdorf wrote:
>> I don't think this generator question is any different. We need to
>> explain generators in the simplest way possible. The simplest way to
>> explain generators is to not even worry about them being generators at
>> all. Simply say that functions can now return arrays one element at a
>> time using the new yield keyword. That's all.
> 
> It's this 'concept' that I am having trouble seeing in the general
> process that is required using PHP to generate web pages. At the end of
> the day I have to generate the finished page or sub-page so I need all
> the results anyway. 

Sure, but that doesn't mean it has to all be in memory at the same time.
You can read lines from a large file line-by-line, process that line and
output the result before you move onto the next line.

-Rasmus

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to