---
title: "[RFC] Duration class"
url: https://daily.dev/posts/rfc-duration-class-web8nsdzs
source_url: https://externals.io/message/131504
type: article
source: "externals.io"
published: 2026-06-23T13:13:18.341Z
updated: 2026-06-23T13:13:43.464Z
tags: ["architecture", "php"]
reading_time: 79
upvotes: 1
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# [RFC] Duration class

**[externals.io](https://daily.dev/sources/externals)** · 79 min read · 1 upvotes · 0 comments

## Summary

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.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://externals.io/message/131504>

## Similar posts on daily.dev

- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-kfhwxzofy) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-h255ra0w8) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-jaakxgyjc) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-ilmuf5vup) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-tn9jsqdxr) · externals.io · 0 upvotes · 0 comments

---

Tags: [#architecture](https://daily.dev/tags/architecture), [#php](https://daily.dev/tags/php)

[View this post on daily.dev](https://daily.dev/posts/rfc-duration-class-web8nsdzs)
