Bug #16322 Updated: Page stops loading when processing arrays in foreach cycles inside functions
| From: | derick@php.net | Date: | Tue, 18 Jun 2002 08:34:12 +0000 |
| Subject: | Bug #16322 Updated: Page stops loading when processing arrays in foreach cycles inside functions | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-11055@lists.php.net to get a copy of this message | ||
ID: 16322
Updated by: derick@php.net
Reported By: lsro@mega.ist.utl.pt
-Status: Open
+Status: Feedback
Bug Type: Arrays related
Operating System: Windows XP
PHP Version: 4.1.2
New Comment:
Please provide a short, ready-to-run (ie. no external dependencies) so
that we can try to reproduce it.
Derick
Previous Comments:
------------------------------------------------------------------------
[2002-03-27 16:52:26] lsro@mega.ist.utl.pt
First of all, I'm running PHP 4.1.2 as a script with Apache 1.3 on
Windows XP Pro. I'm only using gd2 and gettext as modules.
To illustrate what is happening to me right now, suppose I got an array
$authors from a database, each containing another array with two
key-value pairs (aid, author.)
Now, in order to print it out, I use:
function listArticleAuthors() {
global $authors;
if ($authors)
foreach($authors as $a)
echo "<li><a href='author.php?id=" .
$a[aid] . "'>" . $a[name] . "</a></li>";
return;
}
I have three or four other functions somewhat similar to this one,
which iterate through other arrays. The arrays are all very small (no
more than half a dozen elements each.)
Now, there's no problem when I run the code below *outside* the
function. There is also no problem when I'm calling only a couple of
these functions.
But when I call all the functions, or the same function more than once,
the PHP process inexplicably goes zombie and the page stops loading.
It's only when I kill the process using Task Manager that the page
resumes loading as normal. There's no lost output, there is no system
slowdown.
I don't think I'm pushing it too hard: the PHP process just stays
running using very little resources (0% processor, 2 or 3 megs.) Any
idea about what could be happening?
Cheers and thanks!
L.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16322&edit=1