Bogus "Operands have incompatible types"
This warning is not quite right, is it?
<?php
$payload = $expectedValues = [];
foreach ([...$payload, ...$expectedValues] as $field => $value) {
$isStartDate = $field === 'startDate';
}
请先登录再写评论。
With PhpStorm analysis, while $field "might" be int, while 'startDate' is a string, the warning is thrown.
In case however, this inspection hits a code where variables are defined, feel free to share this.
Nothing changes, same warning is still shown:
I don't see why a strict comparison between int and string can be wrong. That's the whole point of `===`.
Php Inspections (EA Extended) plugin agrees with me 😁
Hello,
Thank you for providing the full snippet.
Indeed, here $field is always a string. Therefore, https://youtrack.jetbrains.com/issue/WI-81951 was filed.
You can star and follow this one to get informed once it's resolved.