---
title: "[RFC] Duration class"
url: https://daily.dev/posts/rfc-duration-class-7l9nfw3bw
source_url: https://externals.io/message/131620
type: article
source: "externals.io"
published: 2026-06-29T20:29:01.588Z
updated: 2026-06-29T20:29:29.048Z
tags: ["architecture", "php"]
reading_time: 88
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)** · 88 min read · 0 upvotes · 0 comments

## Summary

Tim Düsterhus and Derick Rethans are proposing a new `Time\Duration` class for PHP 8.6 to represent stopwatch-style durations, primarily to improve the developer experience for timeout-related APIs like the new Polling API. The RFC is intentionally minimal, using a seconds+nanoseconds internal representation (similar to Rust's and Java's Duration). Community discussion covers design questions including: why the highest constructor unit is hours, the absence of an ISO 8601 serialization method (deferred to PHP 8.7), omission of floating-point total methods due to precision concerns, namespace choice (`Time` vs `DateTime`), and whether to use `add`/`sub` methods or a single variadic `sum` method. The authors also explain why they chose not to adopt the JavaScript Temporal API or the `temporal_rs` Rust library, citing PHP's semantic closeness to Java and the complexity of integrating Rust into the Zend Engine.

## Full article

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

## Similar posts on daily.dev

- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-gnv00ykji) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-lajcku0k4) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-gil3vr6jm) · 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-7l9nfw3bw)
