---
title: "[RFC] Duration class"
url: https://daily.dev/posts/rfc-duration-class-wb3yogost
source_url: https://externals.io/message/131385
type: article
source: "externals.io"
published: 2026-06-18T16:45:40.025Z
updated: 2026-06-18T17:47:10.313Z
tags: ["architecture", "php"]
reading_time: 8
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)** · 8 min read · 0 upvotes · 0 comments

## Summary

Tim Düsterhus and Derick are proposing a new `Time\Duration` class for PHP 8.6 to represent stopwatch-style durations, primarily to improve developer experience for timeout APIs and the new Polling API. The class uses a seconds + nanoseconds internal representation (similar to Rust's and Java's Duration), supports constructors up to hours, and includes `Duration::fromIso8601String` accepting ISO-8601 period strings starting with 'PT'. The RFC is intentionally minimal, deferring features like ISO-8601 serialization and floating-point total methods to future versions. Discussion touches on namespace choice (`Time` vs `DateTime`), floating-point precision concerns, and alignment with Rust/Java/Go conventions. This is positioned as the first step in a modernized PHP date/time API, following the pattern of new namespaced APIs introduced in PHP 8.2–8.5.

## Full article

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

## Similar posts on daily.dev

- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-zw0yjhyrr) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-nkvijzmgg) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-755gt56rw) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-bfq3ji40d) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-irkwvqcpi) · 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-wb3yogost)
