|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19285 foreach runs only 1 time
Submitted: 2002-09-07 12:49 UTC Modified: 2002-09-07 13:28 UTC
From: snowdyyd at hotmail dot com Assigned:
Status: Not a bug Package: Arrays related
PHP Version: 4.2.3 OS: windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
40 + 15 = ?
Subscribe to this entry?

 [2002-09-07 12:49 UTC] snowdyyd at hotmail dot com
The problem is that I used a foreach on $DBfile that = file("DBfile.txt"); (that file has 14 lines)
like this: foreach ($DBfile as $DBrida) {
but the foreach ran only 1 time (i checked it with echos)
the possible problem was that it had too many operations in it including other foreach'es. (and there were no errors)
I replaced the foreach with a counter and while loop and the script worked perfectly. 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-07 13:28 UTC]
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Dec 02 20:03:58 2022 UTC