|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-02-10 10:49 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 23:00:01 2025 UTC |
I was looking through a php manual that I downloaded yesterday (php_manual_en.pdf.zip) and noticed what looks like an error on page 149 (PDF page 216). Right at the bottom of the page, there is a foreach() usage example. Example 2 is as follows: /* foreach example 2: value (with key printed for illustration) */ $a = array (1, 2, 3, 17); $i = 0; /* for illustrative purposes only */ foreach($a as $v) { print "\$a[$i] => $v.\n"; } But $i will always be 0, as it is never modified in the loop! I found the same error in the online manual at http://www.php.net/manual/en/control-structures.foreach.php