PHP 8.2.31
Preview: RequireExplicitBooleanOperatorPrecedenceStandard.xml Size: 1.05 KB
/opt/cpanel/ea-wappspector/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/CodeAnalysis/RequireExplicitBooleanOperatorPrecedenceStandard.xml

<documentation title="Require Explicit Boolean Operator Precedence"
    >
    <standard>
    <![CDATA[
    Forbids mixing different binary boolean operators (&&, ||, and, or, xor) within a single expression without making precedence clear using parentheses.
    ]]>
    </standard>
    <code_comparison>
        <code title="Valid: Making precedence clear with parentheses.">
        <![CDATA[
$one = false;
$two = false;
$three = true;

$result = <em>($one && $two) || $three</em>;
$result2 = <em>$one && ($two || $three)</em>;
$result3 = <em>($one && !$two) xor $three</em>;
$result4 = <em>$one && (!$two xor $three)</em>;

if (
    <em>($result && !$result3)
    || (!$result && $result3)</em>
) {}
        ]]>
        </code>
        <code title="Invalid: Not using parentheses.">
        <![CDATA[
$one = false;
$two = false;
$three = true;

$result = <em>$one && $two || $three</em>;

$result3 = <em>$one && !$two xor $three</em>;


if (
    <em>$result && !$result3
    || !$result && $result3</em>
) {}
        ]]>
        </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).