Skip to content

SimpleXMLElement types are wrong #9575

@stof

Description

@stof

Bug report

Dynamic properties on SimpleXMLElement don't ever return null. Even for a non-existent child, it still returns a SimpleXMLElement (with a count of 0). See https://3v4l.org/a6OFI for the proof.

Array access on SimpleXMLElement also returns SimpleXMLElement objects, not mixed

Code snippet that reproduces the problem

https://phpstan.org/r/5940e7c0-7917-48e8-b4d2-b218480877dc

Expected output

SimpleXMLElement types instead of nullable or mixed types.

Did PHPStan help you today? Did it make you happy in any way?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions