---
title: "[RFC] Duration class"
url: https://daily.dev/posts/rfc-duration-class-ilmuf5vup
source_url: https://externals.io/message/131749
type: article
source: "externals.io"
published: 2026-07-03T22:46:06.116Z
updated: 2026-07-03T22:46:30.189Z
tags: ["architecture", "php"]
reading_time: 124
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)** · 124 min read · 0 upvotes · 0 comments

## Summary

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 targets a minimal, correct API 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, intentional omission of ISO 8601 serialization and floating-point total methods for now, use of the `Time` namespace over `DateTime`, and the `fromIso8601String` method accepting only time-component period strings (starting with `PT`). Community feedback raised questions about adding `getTotalSeconds()`, a `sum()` method instead of separate `add`/`sub`, and whether to adopt the `temporal_rs` Rust library — which the authors declined, citing PHP-specific API design needs and Zend Engine integration complexity.

## Full article

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

## 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-7nlgcruab) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-web8nsdzs) · externals.io · 1 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-ilmuf5vup)
