Re: DateTimeImmutable::modify() return type: doc or language bug?
| From: | Larry Garfield | Date: | Tue, 03 Jan 2023 15:06:45 +0000 |
| Subject: | Re: DateTimeImmutable::modify() return type: doc or language bug? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-119224@lists.php.net to get a copy of this message | ||
On Tue, Jan 3, 2023, at 3:48 AM, Philip Hofstetter wrote:
> 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
That sounds like a doc bug to me. It's likely the doc page hasn't been updated since
before the static return was added. The code looks like it's doing the right
thing.
Doc PR, please and thank you!
--Larry Garfield