PHP Classes

File: vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopShouldBeWhileLoopUnitTest.1.inc

Recommend this page to a friend!
  Classes of Adeleye Ayodeji   Download Installed Plugin   vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopShouldBeWhileLoopUnitTest.1.inc   Download  
File: vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopShouldBeWhileLoopUnitTest.1.inc
Role: Example script
Content type: text/plain
Description: Example script
Class: Download Installed Plugin
Download a WordPress plugin as a ZIP archive
Author: By
Last change:
Date: 2 days ago
Size: 594 bytes
 

Contents

Class file image Download
<?php
for ($i = 0; $i < 10; $i++) {
   
// Everything is fine
}

for (;
$it->valid();) {
   
$it->next();
}

for (;((
$it1->valid() && $foo) || (!$it2->value && ($bar || false)));/*Could be ignored*/) {
   
$it1->next();
   
$it2->next();
}

for (
$i = 0, $j = 10; $i < $j; $i++, $j--) {
    echo
"i: $i, j: $j\n";
}

for (;;) {
    if (
$i >= 10) {
        break;
    }
    echo
$i++;
}

for (
$i = 0; $i < 10; $i++): ?>
<p><?php echo $i; ?></p>
<?php endfor;

for (
$i = 0, $len = count($array); $i < $len; $i++):
    echo
$array[$i];
endfor;

for (;
$i < 10;):
    echo
$i;
   
$i++;
endfor;