#19285 [NEW]: foreach runs only 1 time

From: Date: Sat, 07 Sep 2002 17:49:29 +0000
Subject: #19285 [NEW]: foreach runs only 1 time
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-18630@lists.php.net to get a copy of this message
From: snowdyyd@hotmail.com Operating system: windows PHP version: 4.2.3 PHP Bug Type: Arrays related Bug description: foreach runs only 1 time 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. -- Edit bug report at http://bugs.php.net/?id=19285&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=19285&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=19285&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=19285&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=19285&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=19285&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=19285&r=support Expected behavior: http://bugs.php.net/fix.php?id=19285&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=19285&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=19285&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=19285&r=globals

« previous php.bugs (#18630) next »