PHP 8.2.31
Preview: ForLoopWithTestFunctionCallStandard.xml Size: 746 B
/opt/cpanel/ea-wappspector/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/ForLoopWithTestFunctionCallStandard.xml

<documentation title="For Loops With Function Calls in the Test">
    <standard>
    <![CDATA[
    For loops should not call functions inside the test for the loop when they can be computed beforehand.
    ]]>
    </standard>
    <code_comparison>
        <code title="Valid: A for loop that determines its end condition before the loop starts.">
        <![CDATA[
<em>$end = count($foo);</em>
for ($i = 0; $i < $end; $i++) {
    echo $foo[$i]."\n";
}
        ]]>
        </code>
        <code title="Invalid: A for loop that unnecessarily computes the same value on every iteration.">
        <![CDATA[
for ($i = 0; $i < <em>count($foo)</em>; $i++) {
    echo $foo[$i]."\n";
}
        ]]>
        </code>
    </code_comparison>
</documentation>

Directory Contents

Dirs: 0 × Files: 11

Name Size Perms Modified Actions
582 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.11 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
549 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
654 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
746 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
675 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
1.05 KB lrw-r--r-- 2025-11-04 16:30:35
Edit Download
918 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
631 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
601 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download
767 B lrw-r--r-- 2025-11-04 16:30:35
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).