Le dim. 21 juin 2026, 01:34, Morgan <[email protected]> a écrit :
> 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. > Indeed Duration::divmod is the way forward just wondering about the return type. Should it be an array or a immutable DTO with .2 properties quotient and remainder? Best regards, Ignace >
