Tim Düsterhus and Derick Rethans have proposed a new `Time\Duration` class for PHP 8.6, designed to represent stopwatch-style durations 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 `Time` namespace choice over `DateTime`, omitting floating-point conversion methods to avoid precision/rounding issues, limiting ISO 8601 output to a future release, and why the temporal_rs Rust library was not adopted. Community feedback covers API method naming (add/sub vs. sum), namespace conventions, and missing convenience methods like `getTotalSeconds()`.
517 Impressions