---
title: "[RFC] Duration class"
url: https://daily.dev/posts/rfc-duration-class-kajpdzdqe
source_url: https://externals.io/message/131458
type: article
source: "externals.io"
published: 2026-06-22T15:27:25.177Z
updated: 2026-06-22T15:28:04.442Z
tags: ["architecture", "php"]
reading_time: 52
upvotes: 0
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)** · 52 min read · 0 upvotes · 0 comments

## Summary

Tim Düsterhus and Derick Rethans have proposed a new `Time\Duration` class for PHP 8.6, targeting 'stopwatch' or '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 methods to avoid precision/rounding issues, using the `Time` namespace (aligned with Rust, Java, Go conventions), and rejecting the temporal_rs Rust library as a backend due to integration complexity. Community feedback covers suggestions like a variadic `sum()` method instead of separate `add`/`sub`, namespace naming, and ISO 8601 format concerns.

## Full article

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

## Similar posts on daily.dev

- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-c8sinqz7q) · 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-g1bpxesky) · 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-kajpdzdqe)
