Re: [RFC] Duration class

From: Date: Sun, 21 Jun 2026 13:52:23 +0000
Subject: Re: [RFC] Duration class
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-131437@lists.php.net to get a copy of this message
Hi On 6/20/26 17:50, ignace nyamagana butera wrote:
Also why are there some restrictions on the factor argument of divideBy and multiplyBy to only accept positive integers ? At least that is what I understood when I quickly checked the proof of concept. Since Duration are signed instances that restriction seems strange ?
Enforcing positive values for multiplication and division means that flipping the sign of a Duration is a deliberate action and not just something that happens as part of another operation. See also the last paragraph in the “Design considerations” section. Best regards Tim Düsterhus

« previous php.internals (#131437) next »