22 lines
255 B
PHP
22 lines
255 B
PHP
<?php
|
|
|
|
// Different types of loop statement
|
|
for($i = 0; $i < 3; ++$i) {
|
|
|
|
foreach($foo as $k => $v) {
|
|
}
|
|
|
|
foreach($foo2 as $v2) {
|
|
}
|
|
|
|
while(true) {
|
|
}
|
|
|
|
do {
|
|
} while (true);
|
|
|
|
}
|
|
|
|
// Loop with no separate body statement
|
|
while (true) echo "hello";
|