ID: 43890 Updated by: [EMAIL PROTECTED] Reported By: jwang at navarik dot com -Status: Open +Status: Feedback Bug Type: Arrays related PHP Version: 5.2.5 New Comment:
Please try using this CVS snapshot: http://snaps.php.net/php5.3-latest.tar.gz For Windows (zip): http://snaps.php.net/win32/php5.3-win32-latest.zip For Windows (installer): http://snaps.php.net/win32/php5.3-win32-installer-latest.msi Previous Comments: ------------------------------------------------------------------------ [2008-01-18 20:47:00] jwang at navarik dot com Description: ------------ The function which is supposed to get a copy of the original array and never mess the original array magically changed the internal pointer of the original array. Noticed it doesn't change the pointer if foreach just loop though the array itself (this seems to be fixed in #40705). However, as it is in the repro code, I loop though a subelement of the array, it still changes the pointer. Reproduce code: --------------- <?php function a($arr) { foreach($arr['k'] as $r) { } } $arr = array( 'k' => array(1) ); a($arr); var_dump(current($arr['k'])); Expected result: ---------------- int(1) Actual result: -------------- bool(false) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43890&edit=1