#35460 [Opn->Bgs]: infinite loop current()/next()
ID: 35460
Updated by: tony2001@php.net
Reported By: sitnikov at infonet dot ee
-Status: Open
+Status: Bogus
Bug Type: *General Issues
Operating System: Linux
PHP Version: 4.4.1
New Comment:
Fixed in CVS about a month ago.
You could just ask me, eh?
Previous Comments:
------------------------------------------------------------------------
[2005-11-28 23:39:52] sitnikov at infonet dot ee
Description:
------------
subj
Reproduce code:
---------------
<?php
$arr = array (1,2,3,4,5);
function foo($data){
$total_row = count($data);
@reset($data);
$row = 1;
while ($tmp = current($data))
{
if ($row>$total_row){
die("To many iteration");
}
print_r($tmp);
$row++;
next($data);
}
}
foo($arr);
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35460&edit=1
Thread (2 messages)