Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False MixedArgument error when using php isset #11064

Open
AlexMinaev19 opened this issue Aug 5, 2024 · 1 comment
Open

False MixedArgument error when using php isset #11064

AlexMinaev19 opened this issue Aug 5, 2024 · 1 comment

Comments

@AlexMinaev19
Copy link

Psalm reports a false MiaxedArgument when using PHP isset.

https://psalm.dev/r/865dff4af9

Copy link

I found these snippets:

https://psalm.dev/r/865dff4af9
<?php

function f (int $a): int
{
    return $a;
}

if (rand(0, 100) === 23) {
    $a = 15;
}

if (isset($a)) {
    f($a);
}
Psalm output (using commit 16b24bd):

INFO: MixedArgument - 13:7 - Argument 1 of f cannot be mixed, expecting int

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant