Tim Düsterhus and Derick Rethans have proposed a new `Time\Duration` class for PHP 8.6, targeting stopwatch/egg-timer style durations to improve developer experience for timeout APIs. The RFC is intentionally minimal, using a seconds+nanoseconds internal representation (similar to Rust's and Java's Duration). Key design decisions discussed include: the highest constructor unit being hours, omitting ISO 8601 serialization for now due to ambiguity, excluding floating-point total methods to avoid precision/rounding issues, using the `Time` namespace (aligned with Rust, Java, and Go conventions rather than JavaScript's Temporal), and accepting only ISO 8601 'Period' strings starting with 'PT'. Community feedback raised questions about adding `getTotalSeconds()`, using `DateTime` as the namespace, and whether to replace `add`/`sub` methods with a variadic `sum()` method.

1h 19m read timeFrom externals.io
Post cover image
1.4K Impressions