Hi
On 6/23/26 14:12, Tim Düsterhus wrote:
Am 2026-06-18 15:47, schrieb Tim Düsterhus:
All that said, you can find the RFC at:
https://wiki.php.net/rfc/duration_class. It hopefully includes all the
important explanation and also provides a rationale as to why we made
the design decisions we made.
Derick and I had a first discussion about the feedback so far and I have
made the following changes to the RFC earlier today.
Regarding the “method naming question” as the last remaining issue, I've
also made a quick informal poll in PHP Foundation Slack and then
discussed the topic with Derick:
`add` and `sub` were in unanimous agreement. So we go with those.
For the other “mathematical operations”, there was a non-trivial number
of folks in favor of abbreviated names (for consistency with BCMath and
GMP). In favor of the -ed suffix was only Larry, who also replied on
list. Given that the class is clearly marked as `readonly`, and that,
following Larry’s reasoning, mathematical operations are generally not
working in-place, we decided not to consider the -ed suffix, since it
would not consistently work (e.g. ->absoluted() as a companion to
->negated() doesn't make sense).
Since the naming policy says that abbreviations should be avoided, but
can be okay if accepted by RFC vote, we decided to actually make it a vote:
We added a secondary vote between the current “full” names (multiplyBy,
divideBy, negate, absolute) and abbreviated names (mul, divBy, neg, abs).
In accordance with policy
(https://github.com/php/policies/blob/main/feature-proposals.rst#required-majority),
this secondary vote will be “biased” in favor of the full names,
matching the original and current proposal (and the non-abbreviation
naming suggested by the naming policy). Specifically, the abbreviated
names will require a 2/3 majority. If 4 folks vote in favor of full
names, and 8 in favor of abbreviations, it will be abbreviations. If
it's 4 in favor of full names, and 7 in favor of abbreviations it will
be full names.
-----------
From what we see all open questions for a “minimally viable API” in PHP
8.6 should be resolved with this change and all possible “Future Scope”
be properly taken into account so we won’t regret anything in the
future. Fingers crossed!
With the feature freeze in the middle of August and the required 14 day
cooldown after making major changes to RFCs, we have a few more days to
make any finishing touches, but we would consider the RFC to be complete
and don’t plan to make any more changes.
Personally I'm super happy with how insightful and productive the
discussion was. I'm really looking forward to seeing you all again for
the upcoming “Future Scope” discussions for PHP 8.7 :-)
Best regards
Tim Düsterhus