note 78788 deleted from control-structures.foreach by googleguy

From: Date: Wed, 14 Nov 2012 22:30:55 +0000
Subject: note 78788 deleted from control-structures.foreach by googleguy
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-191972@lists.php.net to get a copy of this message
Note Submitter: henrik at newdawn dot dk ---- As stated further up the foreach is consuming a lot of memory if used within large arrays - that is - if the array consists of for instance large objects. I had a case where a foreach caused me to run out of the 256 MB memory that PHP is allowed to handle - but changing to a for() statement completly removed both memory and CPU load.

« previous php.notes (#191972) next »