bmewburn / vscode-intelephense

PHP intellisense for Visual Studio Code
https://intelephense.com
Other
1.61k stars 94 forks source link

1.11.0 Does not properly detect type #2925

Closed momala454 closed 3 months ago

momala454 commented 3 months ago

Describe the bug See code

To Reproduce

function hello(string|int $a): void
{
}

/** @param array<string|int|null> $b */
function world(array $b): void
{
    $x = $b['a'];
    if ($x !== null) {
        hello($b['a']);
    }
}

Expected behavior $x and $b['a'] are the same. In the code, it tells that i'm calling hello with a string|int|null, but it cannot be null

Platform and version 1.11.0 pre release

momala454 commented 3 months ago

sorry that was phpstan ...