Skip to content

Null coalescing on unknown data #3958

@temp

Description

@temp

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions