|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: snowdyyd at hotmail dot com
New email:
PHP Version: OS:


 [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: Tue Dec 06 03:03:58 2022 UTC