Re: [RFC] Duration class
| From: | Morgan | Date: | Sat, 20 Jun 2026 23:31:25 +0000 |
| Subject: | Re: [RFC] Duration class | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-131435@lists.php.net to get a copy of this message | ||
On 2026-06-21 03:50, ignace nyamagana butera wrote:
Hi Tim and Marc I would go with two methods if possible : Duration::countOf(Duration $duration): int; // which would act a bit like intdiv Duration::remainder(Duration $duration): Duration; // which would return the remainder as a Duration instance But that's just a thought.And BCMath just recently picked up a function to do both of those in a single call, since calculating one gives you the other for free and frequently users want both.