---
title: "[RFC] Duration class"
url: https://daily.dev/posts/rfc-duration-class-c8sinqz7q
source_url: https://externals.io/message/131488
type: article
source: "externals.io"
published: 2026-06-23T00:43:24.561Z
updated: 2026-06-23T00:55:45.263Z
tags: ["architecture", "php"]
reading_time: 70
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)** · 70 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 or egg-timer durations for use in 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 total methods to avoid precision/rounding issues, using the `Time` namespace (aligned with Rust, Java, and Go conventions rather than JavaScript's Temporal), and accepting only ISO 8601 'Period' strings starting with 'PT'. Community feedback raises questions about add/sub vs. a variadic sum method, namespace choice, and whether to adopt the temporal_rs Rust library instead of building a new API from scratch.

## Full article

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

## Similar posts on daily.dev

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