|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-05-11 18:25 UTC] rc at opelgt dot org
Description: ------------ When I give an array to loop through the name of the array and if the array given is with a key, in this case $i, should make no difference. PHP4 didnt make a warning, PHP5 instead does. Test script: --------------- foreach($array[$i] as $key => $val) results in an warning message. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 11:00:01 2025 UTC |
The following script works fine for me: <?php $array = array( array('foo','bar'), array('test','hello'), ); $i = 0; foreach ($array[$i] as $key => $val) { echo $key . $val; } ?> You'll have to provide a complete script that gives unexpected/incorrect warnings.