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

Wrong type on dynamic object with string|null #2869

Open
MauroVinicius opened this issue Apr 27, 2024 · 0 comments
Open

Wrong type on dynamic object with string|null #2869

MauroVinicius opened this issue Apr 27, 2024 · 0 comments
Labels

Comments

@MauroVinicius
Copy link

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

@bmewburn bmewburn added the bug label Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants