Skip to content

DateTimeImutable::modify() should return static #9042

@pilif

Description

@pilif

DateTime type issues strike back...

https://psalm.dev/r/09e238bf00

I expect $foo2 to be of type Subclass and indeed, according to PHP it is:

https://3v4l.org/j9ZSo

I agree that the PHP manual disagrees, so that should probably be raised on the php internals list too, but seeing how big a BC break it would be for PHP to change this behavior, I assume that this is a doc bug, not a language issue.

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