|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-07-02 02:22 UTC] sterling at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Jun 18 06:00:02 2026 UTC |
It should be documented that foreach() uses a copy of the passed array, being completely independent from the original $a - for the reason that each() (and next() and so on) works directly on the arrays pointer <?php $a=array(0,1,2,3,4,5,6); foreach ($a AS $val) { print $val; list(,$val)=each($a); list(,$val)=each($a); next($a); print $val; } ?>