Re: Add __toString() to DateInterval
From: Moritz Friedrich Date: Thu, 18 Mar 2021 09:30:25 +0000 Subject: Re: Add __toString() to DateInterval References: 1 2 3 4 5 6 7 8 Groups: php.internals Request: Send a blank email to internals+get-113599@lists.php.net to get a copy of this message
> Would a reasonable way forward be to have such a named method, and have it throw an exception > if the instance is not representable in that form? > > That way, you'd be guaranteed that new DateInterval($period->toIsoPeriodString()) would > result in an equivalent object, rather than discarding special relative values. Yep, this sounds like a good idea. Derick, would this work for you? Regards, Moritz
Thread (19 messages)
| « previous | php.internals (#113599) | next » |
|---|