Tim Düsterhus and Derick Rethans have proposed a new `Time\Duration` class for PHP 8.6 to represent stopwatch-style durations, primarily to improve the developer experience for timeout-related APIs like the new Polling API. The RFC is intentionally minimal, using a seconds+nanoseconds internal representation (similar to Rust's and Java's Duration). The mailing list discussion covers design decisions including: why the highest constructor unit is hours while internal storage uses seconds; the absence of an ISO 8601 serialization method (deferred to PHP 8.7); omission of floating-point total methods due to precision concerns; the choice of `Time` namespace over `DateTime`; and whether to use `add`/`sub` methods or a single variadic `sum` method. The RFC is positioned as the first step toward a modernized PHP date/time API, following the pattern of new namespaced APIs introduced in PHP 8.2–8.5.

56m read timeFrom externals.io
Post cover image
453 Impressions