Re: [RFC] Duration class
| From: | Tim Düsterhus | Date: | Mon, 22 Jun 2026 17:37:53 +0000 |
| Subject: | Re: [RFC] Duration class | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-131471@lists.php.net to get a copy of this message | ||
Hi
Am 2026-06-22 01:07, schrieb Morgan:
Oof. Naming. The only term I can find that is specifically about dividing one duration by another is "beat", but that's definitely domain-specific. 'periodCount' or 'countPeriods' come to mind. Since in 'n/d' we're counting how many times duration 'd' occurs during duration 'n' we're basically multiplying the duration by frequency '1/d'; the inverse of the frequency - 'd' itself - is called the period. Which word is also used for "named subdivision of historical time", "class-sized subdivision of a school day", and so on. The biggest hangup with that name is that it doesn't explicitly state that it returns the remainder as well. periodParts? periodDivide?Thank you for the suggestions. I quite like period. I'll also check with Derick if he has any good ideas (and regarding the Duration divided by Duration bit in general). Best regards Tim Düsterhus