#35460 [Opn->Bgs]: infinite loop current()/next()

From: Date: Mon, 28 Nov 2005 22:42:29 +0000
Subject: #35460 [Opn->Bgs]: infinite loop current()/next()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-89323@lists.php.net to get a copy of this message
 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)

« previous php.bugs (#89323) next »