1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 17:52:45 +01:00
psalm/docs/running_psalm/issues/RedundantIdentityWithTrue.md

20 lines
313 B
Markdown
Raw Normal View History

# RedundantIdentityWithTrue
Emitted when comparing a known boolean with true and the `strictBinaryOperands` flag is set to true.
```php
<?php
function returnsABool(): bool {
return rand(1, 2) === 1;
}
if (returnsABool() === true) {
echo "hi!";
}
if (returnsABool() !== false) {
echo "hi!";
}
```