Ninjakreborn Posted April 17, 2006 Share Posted April 17, 2006 I have been playing with these, I can get the browser to create something over and over again and never stop, like have it say something for eternity, in what possible situations could an infinite while loop end up being effective, i can think of some small samples, but is there a few major samples anyone can give me to understand the effectiveness of these, I heard these also have there purposes in certain situations. Link to comment https://forums.phpfreaks.com/topic/7639-for-and-while-loops/ Share on other sites More sharing options...
katocan Posted April 17, 2006 Share Posted April 17, 2006 Well you could crash someones browser. Link to comment https://forums.phpfreaks.com/topic/7639-for-and-while-loops/#findComment-27844 Share on other sites More sharing options...
Ninjakreborn Posted April 17, 2006 Author Share Posted April 17, 2006 I am meaning what are the uses of the while loop, and for loop, I know in major programs they can be of great helped, under heavily controlled situations. For instance, in a major forum program, would you ever need an infinite loop to do something specific, if so what, or are infinite loops completely uses on all levels when speaking about php, I know with javascript they are very helpful for instance, if you want scrolling text then you set an infinite loop to allow the text to scroll forever at a timed interval setting, also pictures, you want a gallery that cycles through all pictures in the file, you set an infinite loop, just under a specific guided speed, and with people having the ability to break the loop, by selecting buttons to go on there own pace, so I know it has good uses in javascript, but now what about php, what major purposes are they for. Link to comment https://forums.phpfreaks.com/topic/7639-for-and-while-loops/#findComment-27846 Share on other sites More sharing options...
ToonMariner Posted April 17, 2006 Share Posted April 17, 2006 well...infinite loops on a standard page served to a browser will normally time out ater 30s of script parsing (thats the default in the ini file which can be changed - but people don't wait 30 s for a [age anymore!!!!)you can however use them in cron jobs that run in the background on the server for 'constant' data processing, i.e. stockmarket figuresothers will ,I'm sure, give further examples Link to comment https://forums.phpfreaks.com/topic/7639-for-and-while-loops/#findComment-27849 Share on other sites More sharing options...
Ninjakreborn Posted April 17, 2006 Author Share Posted April 17, 2006 thank you for the answer, that helped. Link to comment https://forums.phpfreaks.com/topic/7639-for-and-while-loops/#findComment-27855 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.