no inspection for invalid enum to string comparison

I would expect to get a warning if I compare a backed enum to a string without using ->value

The code below does not complain when using ==. Only with ===.
However, what should it cast to when using == ? In my opinion it this comparison never makes sense and it should therefore highlight it even when just using ==

enum UserType: string {
    CASE ADMIN = 'admin';
}

function doSomething (UserType $userType) {
    if('someInvalidType' == $userType) {
        echo 'test';
    }
}
0

请先登录再写评论。