循环处理在迭代大量索引值时是否依赖于echo语句?

时间:2016-09-14 09:23:09

标签: php loops large-data

我一直在使用PHP中的2个嵌套循环,其中外部循环在具有大约25K记录的数组上执行,并且在内部循环中正在为具有大约3000的数组执行一些处理记录了。

我发现的一个奇怪的问题是当我在外部循环中使用echo语句时,脚本以预期的结果终止但没有echo语句,它继续处理并在大约3分钟后终止而没有任何结果

这里有什么问题?

示例伪代码:

for ($index = 0 ; $index <= 25,000 ; $index++)
{
  for($indx = 0 ;  $indx <= 3,000 ; $indx++)
  {
    //process logic
  }
echo "Test Flow";   //with this, it works. Without it, enters infinite loop
} 

0 个答案:

没有答案