ID:               35095
 Updated by:       [EMAIL PROTECTED]
 Reported By:      yanik at lecourriel dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Variables related
 Operating System: Windows XP SP2
 PHP Version:      4.4.1
 New Comment:

Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

.


Previous Comments:
------------------------------------------------------------------------

[2005-11-04 01:57:01] yanik at lecourriel dot com

Description:
------------
Array internal pointer does't work propely when passed to a function by
reference.

Reproduce code:
---------------
$t = array('firstName' => 'Yanik', 'lastName' => 'Lupien');

// Cause an infinit loop, always display first key
function test(&$t) {
 for(reset($t); !is_null($key = key($t)); next($t)) {
  print "{$key}<br/>";  
 }
}

//Work well
for(reset($t); !is_null($key = key($t)); next($t)) {
        print "{$key}<br/>";    
}

// Infinit loop
test($t);

Expected result:
----------------
firstName
lastName
firstName
lastName


Actual result:
--------------
firstName
lastName
firstName
firstName
firstName
firstName
firstName
firstName
...



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=35095&edit=1

Reply via email to