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

Null coalescing on unknown data #3958

Closed
temp opened this issue Jan 23, 2025 · 2 comments
Closed

Null coalescing on unknown data #3958

temp opened this issue Jan 23, 2025 · 2 comments

Comments

@temp
Copy link

temp commented Jan 23, 2025

I'm building an object datastructure from an http call, for the sake of simplicity I changed it to loading a json file in this example:
https://phpstan.org/r/a9d7a22a-8f7c-4b29-8048-465055cf094b

Why doesn't the null coalescing operator silencing the "Cannot access offset 'currency' on mixed." error?

What do I need to do in such a case?

PHPStan version is: PHPStan - PHP Static Analysis Tool 2.1.2

@jrfnl
Copy link
Contributor

jrfnl commented Jan 23, 2025

Closing as invalid. I suggest you ask in the PHPStan repo.

@jrfnl jrfnl closed this as not planned Won't fix, can't repro, duplicate, stale Jan 23, 2025
@temp
Copy link
Author

temp commented Jan 23, 2025

Oops. Sorry.

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

2 participants