---
title: "[RFC] Duration class"
url: https://daily.dev/posts/rfc-duration-class-kszxgbqns
source_url: https://externals.io/message/131502
type: article
source: "externals.io"
published: 2026-06-23T12:27:21.871Z
updated: 2026-06-23T12:27:44.826Z
tags: ["architecture", "php"]
reading_time: 78
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)** · 78 min read · 0 upvotes · 0 comments

## Summary

A PHP internals mailing list thread discussing a proposed RFC to introduce a new `Time\Duration` class in PHP 8.6. The class is designed to represent stopwatch-style durations (not calendar periods) to improve developer experience for timeout APIs, particularly the new Polling API. The RFC proposes a minimal API using seconds+nanoseconds internal representation, similar to Rust's and Java's Duration types. Discussion covers design decisions including: why the highest constructor unit is hours, omission of ISO 8601 serialization (deferred to PHP 8.7), exclusion of floating-point methods due to precision concerns, namespace choice (`Time` vs `DateTime`), and whether to use `add`/`sub` methods or a single variadic `sum` method. The RFC is explicitly positioned as the first step toward a modernized PHP date/time API.

## Full article

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

## Similar posts on daily.dev

- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-xgjb2no0i) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-bsqz20wx4) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-rxgaeger7) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-bncpnjcsw) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-dzweopaqb) · 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-kszxgbqns)
