ID: 36154 Updated by: [EMAIL PROTECTED] Reported By: dmitriy dot buldakov at etadirect dot com -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: FreeBSD 5.3 PHP Version: 4.4.2 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Previous Comments: ------------------------------------------------------------------------ [2006-01-25 10:18:14] dmitriy dot buldakov at etadirect dot com Description: ------------ In case of assignment to a variable another variable that contains an array with positioned cursor the old array loses cursor position but array in new variable cathes it. I think - the initial array ($a) cursor should be untouched. The copied array ($c) cursor can be copied or reset, but its behavior should be documented. Reproduce code: --------------- <?php $a = array(1,2,3,4,5,6,7); $b = $a; next($a); print 'next($a); ...'."\n"; print ' current($a) = '.current($a)."\n"; print ' current($b) = '.current($b)."\n"; $c = $a; print '$c = $a; ...'."\n"; print ' current($a) = '.current($a)."\n"; print ' current($b) = '.current($b)."\n"; print ' current($c) = '.current($c)."\n"; ?> Expected result: ---------------- bash-3.00# php test.php next($a); ... current($a) = 2 current($b) = 1 $c = $a; ... current($a) = 2 current($b) = 1 current($c) = 1 bash-3.00# or bash-3.00# php test.php next($a); ... current($a) = 2 current($b) = 1 $c = $a; ... current($a) = 2 current($b) = 1 current($c) = 2 bash-3.00# Actual result: -------------- bash-3.00# php test.php next($a); ... current($a) = 2 current($b) = 1 $c = $a; ... current($a) = 1 current($b) = 1 current($c) = 2 bash-3.00# ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36154&edit=1