A PHP internals mailing list thread discussing a proposed RFC to introduce a new `Time\Duration` class in PHP 8.6. The class would represent stopwatch-style durations (seconds + nanoseconds internally) to improve developer experience for timeout APIs, particularly the new Polling API. The RFC is intentionally minimal, targeting correctness and future compatibility. Discussion covers design decisions including the `Time` namespace choice (vs `DateTime`), omission of ISO 8601 serialization and floating-point methods for now, and whether to use `add`/`sub` vs a variadic `sum` method. The proposal is positioned as the first step toward a modernized date/time API in PHP, following the pattern of new namespaced APIs introduced in PHP 8.2–8.5.
536 Impressions