什么是“for(;;)”?这个代码的语法? [英] What is the "for(;;)" syntax in this code?

查看:231
本文介绍了什么是“for(;;)”?这个代码的语法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  for(;;)
{
if(!$ monitor-> Throttle($ cause))
die('致命错误: $显示器 - >错误);

if($ cause == THROTTLE_CAUSE_NONE)
break;

sleep(60);

我是一个初学php开发者。那么如何阅读前面的代码中的for语法。是否有效?



我从 http://www.phpclasses.org/blog/post/132-Accelerate-Page-Accesses-Throttling-后台任务不寻常的网站加速技术部分2.html

解决方案

for(;;)是一个C语言,意思是做永远,一个无限循环。这个循环只有在 die 语句触发(剧烈),或者原因被设置为 THROTTLE_CAUSE_NONE (不是如此剧烈)。
$ b $

对于循环,它是一个循环,没有预先设置,没有条件,也没有迭代后的命令,实际上与相同,而真正的(伪代码)。


   for(;;)
   {
     if(!$monitor->Throttle($cause))
       die('Fatal error: '.$monitor->error);

     if($cause == THROTTLE_CAUSE_NONE)
       break;

     sleep(60);
   }

i'm a beginner php developer. So how do you read the "for" syntax in previous code. is it valid ?

i got them from http://www.phpclasses.org/blog/post/132-Accelerate-Page-Accesses-Throttling-Background-Tasks-Unusual-Site-Speedup-Techniques-Part-2.html

解决方案

for(;;) is a C idiom which means "do forever", an infinite loop. This loop will only exit when either the die statement fires (violently) , or the cause is set to THROTTLE_CAUSE_NONE (not so violently).

It's a for loop with no pre-setup, no condition and not post-iteration commands, effectively the same as while true (pseudo-code).

这篇关于什么是“for(;;)”?这个代码的语法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆