note 6618 deleted from function.each by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 06:50:24 +0000 |
| Subject: | note 6618 deleted from function.each by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196666@lists.php.net to get a copy of this message | ||
Note Submitter: phpmanual at devin dot com
----
Note further that each() performs a shallow copy
of the value side of an (assoc) array; if you need to iterate on deep structures, something like:
<?php
reset($A); while (list($k,) = each($A)) {
$elem = &$A[$k];
/* ... */
}
?>
Is needed. Copy construction would be handy to have here.