[nycphp-talk] PHP Scope in foreach construct.

Anthony Wlodarski anthony at
Mon Jan 26 12:27:43 EST 2009

When working with foreach constructs do the functions and variables defined get returned to the garbage collector on each iteration or does the foreach have to finish execution before things can be returned to the garbage collector?

The reason that I ask is because we are generating data for Google Maps and they require one very large XML file which keeps blowing our memory size definition inside the php.ini file.  What we might end up doing is creating the XML file in batches of lets say 500 items or less and then append the files manually.

I figured this was an interesting question and I can't find any answers anywhere else (even on docs).

Anthony Wlodarski <>
Web Applications Developer
568 Broadway Ste. 605
New York, NY, 10012
(o) 646.786.1944
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the talk mailing list