note 53046 deleted from control-structures.foreach by danbrown
| From: | danbrown@php.net | Date: | Tue, 28 Apr 2009 13:10:04 +0000 |
| Subject: | note 53046 deleted from control-structures.foreach by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-153922@lists.php.net to get a copy of this message | ||
Note Submitter: flobee at gmail dot com
----
be aware! take the note in the manual serious: "foreach operates on a copy of the specified
array"
when working with complex systems you may get memory problems because of all this copies of arrays.
i love this function (easy to use) and use it more often than "for" or "while"
functions but now i have really problems on this and finally found the reason (which can be a mess
to find out)!
the sum of memory usage sometimes can be *2 than you really need.