---
title: "[RFC] Duration class"
url: https://daily.dev/posts/rfc-duration-class-k3vcw9wkg
source_url: https://externals.io/message/131465
type: article
source: "externals.io"
published: 2026-06-22T16:59:23.034Z
updated: 2026-06-22T17:04:55.627Z
tags: ["architecture", "php"]
reading_time: 57
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)** · 57 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, with constructors like `Duration::fromHours()` and parsing via `Duration::fromIso8601String()`. Discussion covers design decisions including: why floating-point methods were omitted (precision/rounding concerns), why the `Time` namespace was chosen over `DateTime`, ISO 8601 string format clarifications, whether to use `add`/`sub` vs a variadic `sum()` method, and why using the JavaScript Temporal `temporal_rs` Rust library was rejected in favor of a PHP-native API.

## Full article

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

## Similar posts on daily.dev

- [\[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-xgjb2no0i) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-kszxgbqns) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-9e9zzqshj) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-3etjrdmbp) · 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-k3vcw9wkg)
