|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-11-04 18:38 UTC] director at misny dot com
I can't get values assigned to arrays inside a loop when loop repetition is high.
<?
$a=80000;
$b=1;
for($i=0; $i<$a; $i++){
$c[$i]=$b;
}
echo count($c);
?>
Sometimes, this will run, sometimes, it won't. Cutoff of at what number $a this script works varies. Sometimes, it works when $a=70000, sometimes it won't.
This is with using (8)Xeon 700-2 processors with 2GB RAM on a very busy apache/php only server. On our test machine (doing nothing) with (2) P4-1000 processors, $a= can be as high as 130000.
Am I just missing something?
Configure command:
'./configure' '--with-mysql=../mysql' '--with-apache=../apache_1.3.24' '--enable-track-vars' '--enable-mbstring'
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 11:00:02 2025 UTC |
The following works in place of array, so I'll try and see how much memory and CPU this uses. <? $a=1000000; for($i=0; $i<$a; $i++){ $d="ar".$i; $$d=$i; } echo $ar5943; ?>Thank you. I don't know much about the development of Zend engine, so I guess I'll wait for ZE2 to be included in future release of PHP. I had posted a bad sample code. I wasn't trying to fill an array with the same value, so it should have been: <? $a=80000; for($i=0; $i<$a; $i++){ $c[$i]=$i; } echo count($c); ?> And, by the way, this also crashes when $a gets too high or is coupled with another similar loop in the same script: <? $a=1000000; for($i=0; $i<$a; $i++){ $d="ar".$i; $$d=$i; } echo $ar5943; ?> If these work in ZE2, should I bother to do a gdb backtrace using ZE1?