| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2002-02-19 15:48 UTC] cmk@php.net
  [2002-02-19 15:55 UTC] mrobinso@php.net
  | 
    |||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 09:00:01 2025 UTC | 
Using reset on an array of objects seems to alter the array counters of the object's arrays, even though foreach is not dealing with that array. Then, as foreach is supposed to, it doesnt reset them. Example: class child{ var $items = array("A1", "A2", "A3"); } $arr=array(new child, new child, new child); print "step1<br>"; print sizeof($arr)."<br>"; foreach($arr as $v) print $v->items[0]."<br>"; // Three A1 printed print "<hr>step2<br>"; print sizeof($arr)."<br>"; foreach($arr as $v) print $v[1]."<br>"; // No A1 printed