bmewburn / vscode-intelephense

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

Wrong type on dynamic object with string|null #2869

Closed MauroVinicius closed 3 months ago

MauroVinicius commented 5 months ago

Describe the bug When an object is created dynamically with string|null, Intelephense is not recognizing it as an object, in previous versions this recognition worked normally

To Reproduce

<?php

function getPokemon(): ?string
{
    return 'Pikachu';
}

$pokemon = getPokemon();
$element = 'Thunder';

$fighter = new $pokemon;
$fighter->{$element} = 'Thunder';

Expected behavior Recognize as an object and not as string|null

Screenshots image image image

Platform and version Windows 11, Intelephense v1.10.4