DateTimeImmutable::modify() return type: doc or language bug?
| From: | Philip Hofstetter | Date: | Tue, 03 Jan 2023 09:48:56 +0000 |
| Subject: | DateTimeImmutable::modify() return type: doc or language bug? | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-119223@lists.php.net to get a copy of this message | ||
Hi,
DateTimeImmutable::modify() is documented as returning
DateTimeImmutable, but it seems to actually be more specifically
returning static:
https://3v4l.org/j9ZSo
Now I'm wondering whether this is a documentation issue (where it
should return static|false and has not been updated to account for
that return type's availability yet) or whether this is a language
issue and the method is supposed to be returning DateTimeImmutable
instead, though that's probably a considerable BC break.
If you agree that it's a doc bug, I'll submit a PR.
Regards,
Philip