php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16131 For Loop not working (honestly)
Submitted: 2002-03-17 21:43 UTC Modified: 2002-03-17 22:53 UTC
From: paul79 at optonline dot net Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.1.2 OS: FreeBSD 4.5
Private report: No CVE-ID: None
 [2002-03-17 21:43 UTC] paul79 at optonline dot net
Please note the following code, and keep the following in mind.

$disk_$x_name is an array posted from a previous page.
(ex. <input name='disk_0_name[]'><input name='disk_0_name[]'>)

The same thing goes for $total_disks.

This particular loop only outputs "0 => 3" one time, and stops.  Why?  The value of $num_part is 3.  It should at least print it that many of times?  Bug?

<?

for($x=0;$x<count($total_disks);$x++)
{
      eval('$num_part = count($disk_' . $x . '_name);');

      for($y=0;$y<count($num_part);$y++)
      {
             print $y . " => " . $num_part . "<br>";
      }

}
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-17 21:52 UTC] paul79 at optonline dot net
This is bogus.  Sorry, and thanks you
 [2002-03-17 22:53 UTC] philip@php.net
It's okay :)
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Mar 26 12:00:02 2026 UTC