Re: [PHP-DEV] [RFC] Duration class
[email protected] (Morgan)
| Newsgroups | php.internals |
|---|---|
| Message-ID | <[email protected]> |
On 2026-07-02 05:22, Tim Düsterhus wrote: > > To close this out ourselves: While having a static `sum()` method works > for `Duration`s, since the Duration with addition forms an abelian > group, this doesn't work for the other future-scope classes where > addition doesn't form an (abelian) group. More specifically: Adding two > Instants together is not a meaningful operation. Adding a Duration to an > Instant however is. > If you want the appropriate mathematical structure, the timeline models a one-dimensional real affine space, in which Durations are vectors and Instants are points; it's a vector space that has forgotten its origin (the choice of epoch is arbitrary and not a distinguished point of the space - as evidenced by how many of them there are).