for循环提示 Allowed memory size of 134217728 bytes exhausted

逃离我推掉我的手 2023-07-07 03:48 70阅读 0赞
  1. 一个普通的for循环 运行时 提示 Allowed memory size of 134217728 bytes exhausted
  2. 很迷茫 为什么 请教朋友才明白
  3. for $i < count($data)
  4. 这样写 每次for循环 都会重新count
  5. 改成 $dataLen = count($data); 先赋值 再去循环 就好了
  6. $dataLen = count($data);
  7. for($i=0;$i<=$dataLen;$i++){
  8. $data[$i]['num'] = '111';
  9. }

发表评论

表情:
评论列表 (有 0 条评论,70人围观)

还没有评论,来说两句吧...

相关阅读