Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 262 Bytes

RedundantIdentityWithTrue.md

File metadata and controls

15 lines (11 loc) · 262 Bytes

RedundantIdentityWithTrue

Emitted when comparing a known boolean with true and the strictBinaryOperands flag is set to true.

<?php

function returnsABool(): bool {
    return rand(1, 2) === 1;
}

if (returnsABool() === true) {
    echo "hi!";
}