php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #126 for loop sticks, doesn't terminate
Submitted: 1998-03-01 21:32 UTC Modified: 1998-03-01 22:09 UTC
From: zop12 at mindless dot com Assigned: rasmus (profile)
Status: Closed Package: Parser error
PHP Version: 3.0b5 OS: Linux 2.0.33/ANY
Private report: No CVE-ID: None
 [1998-03-01 21:32 UTC] zop12 at mindless dot com
To reproduce the problem the easiest thing to do is something like the following:

for ($i=1;$i=count($array) - 1;$i++) {
   <insert anything you like here...  Doesn't seem to matter>
};

It seems to loop forever getting stuck at whatever number
count($array) returns...  When I remove the - 1 then its OK.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-03-01 22:09 UTC] rasmus
Your condition expression is wrong.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 20:01:30 2024 UTC