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).
That's a forever-loop.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With