What is the shortest loop of each type of Control Structure that when run will go on until the PHP limit (something like 3 minutes) is reached?
For example:
[php]<?php
$x=0;
while(1) {
echo $x;
$x++;
}
?>[/php]
Will run forever (until PHP limit cuts it off), always printing out something while still changing. However, there are
faster and
shorter ways to do this...
The loops have to meet these requirements:
1) Run "forever".
2) Send something to the screen on each run.
3) Change any values stored or echoed on each run.
Make one of each kind:
Code:
for
while
if
else
elseif
do while
switch
foreach
This link will help you
If you think you can make the fastest loop, go ahead and post it. Maybe someone else made it
faster...