doumeinuoye81969 2016-09-14 09:23
浏览 28

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

I've been working with 2 nested loops in PHP where the outer loop is executing over an array that has around 25K records and there is some processing that is being done in the inner loop for an array that has around 3000 records again.

The strange issue that I've found is when I use an echo statement in the outer loop, the script is terminating with expected result but without the echo statement, it keeps on processing and terminates after around 3 minutes without any result.

What can be the issue here?

Sample pseudo code:

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条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 C++ yoloV5改写遇到的问题
    • ¥20 win11修改中文用户名路径
    • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
    • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
    • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
    • ¥15 帮我写一个c++工程
    • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
    • ¥15 关于smbclient 库的使用
    • ¥15 微信小程序协议怎么写
    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?