Re: [RFC] Duration class
| From: | Pierre Joye | Date: | Sun, 19 Jul 2026 05:02:35 +0000 |
| Subject: | Re: [RFC] Duration class | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-132020@lists.php.net to get a copy of this message | ||
Aloha :)
On Tue, Jul 14, 2026 at 3:36 PM Tim Düsterhus <tim@bastelstu.be> wrote:
>
> Hi
>
> On 2026-07-14 05:20, Pierre Joye wrote:
> >> As for the specific case of “the constructors should be injective
> >> functions”, you missed the second half of the quoted sentence: “and
> >> also
> >> based on our experience of working with dates and times both in PHP
> >> and
> >> other programming languages”,
> >
To clarify and settle that discussion for the glory of the archive;
We were like ships passing in the night for some of my disagreements.
The RFC wiki page did not show the additional constructor for other
units, which hence the inconsistency I pointed out for the extra ns
argument in fromSecond.
They are here, and reduce this down to a lower level of bad APIs, more
a pragmatic compromise conciliating different (if not numerous) use
cases. Anything can be perfect, or shipped. Choose one.
I voted yes, ftr.
Cheers,
--
Pierre
@pierrejoye