See https://psalm.dev/r/863d8d0859
In the top function this error is emitted:
Left operand cannot be falsable, got false|int<0, max>
The bottom function does the same, but has no error.
In this case, strpos() is used, but I guess it's a more general issue...