PHP Classes

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

Recommend this page to a friend!
  Classes of Adeleye Ayodeji   Download Installed Plugin   vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopWithTestFunctionCallUnitTest.1.inc   Download  
File: vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/ForLoopWithTestFunctionCallUnitTest.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: Yesterday
Size: 1,434 bytes
 

Contents

Class file image Download
<?php

$a
= array(1, 2, 3, 4);
for (
$i = 0; $i < count($a); $i++) {
   
$a[$i] *= $i;
}

for (
$i = 0, $c = sizeof($a); $i < $c; ++$i) {
   
$a[$i] *= $i;
}

$it = new ArrayIterator($a);
for (
$it->rewind(); $it->valid(); $it->next()) {
    echo
$it->current();
}

for (
$i = 0; MyClass::staticMethod($value); $i++) {
    echo
$i;
}

for (
$i = 0; $countFunction($value); $i++) {
    echo
$i;
}

$a = array(1, 2, 3, 4);
for (
$i = 0; $i < count($a); $i++):
   
$a[$i] *= $i;
endfor;

for (
$i = 0, $c = sizeof($a); $i < $c; ++$i):
   
$a[$i] *= $i;
endfor;

$it = new ArrayIterator($a);
for (
$it->rewind(); $it->valid(); $it->next()):
    echo
$it->current();
endfor;

for (
$i = 0; MyClass::staticMethod($value); $i++) :
    echo
$i;
endfor;

for (
$i = 0; $countFunction($value); $i++):
    echo
$i;
endfor;

for (
$i = 0; (new MyClass)->method(); $i++) {
}

for (;
$i < 10; ++$i) {}

for (;
count($a); ++$i) {}

for (
$i = 0;; ++$i) {}

for (
$i = 0; $i < 10;) {}

for (
$i = 0; count($a);) {}

for (;;
$i++) {}

for (
$i = 0;;) {}

for (;;) {}

for (
$i = 0; (new MyClass)->method(); $i++):
endfor;

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

for (;
count($a); ++$i) :
endfor;

for (
$i = 0;; ++$i) :
endfor;

for (
$i = 0; $i < 10;) :
endfor;

for (
$i = 0; count($a);) :
endfor;

for (;;
$i++) :
endfor;

for (
$i = 0;;) :
endfor;

for (;;) :
endfor;

for (
$i = 0; $i < 10; $i = increment($i)) {}

for (
$i = initialValue(); $i < 10; $i = increment($i)) {}