Hi! > I've replied here: > http://www.mail-archive.com/internals@lists.php.net/msg60706.html
I have a feeling you're concocting a very far-reaching scenarios and making a lot of unbased assumptions there to arrive to pre-defined conclusions. Any programming error can cost a business money, and any problem can be fitted with scenario when it leads to blowing up whole world in the flames of global catastrophe, given enough imagination and wild enough assumptions. However, I do not see any technical reason - not involving far-reaching assumptions following from nowhere - that require repeated generation produce a fatal error. So far all the explanations seem to be to the tune of "because it's so bad!" but I don't see how it's worse than any other fault - such as failing to open the file, database returning no results because of wrong query, etc. We do not produce fatal errors on all of these cases - in fact, we produce fatal errors only when we know there's no reasonable way to go on. I still do not see why just returning empty iterator with suitable warning does not fit the pattern of all exceptional situations we have in PHP that are handled in a similar way. For foreach() specifically, for example, you can put there invalid - non-iterable - value, and it won't be a fatal error. Why non-iterable value from generator should be a fatal error? I think it makes sense to treat it exactly like foreach() treats non-iterable values. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php