---
title: "[RFC] Duration class"
url: https://daily.dev/posts/rfc-duration-class-yjr8kj9kx
source_url: https://externals.io/message/131412
type: article
source: "externals.io"
published: 2026-06-19T16:43:59.274Z
updated: 2026-06-19T16:44:52.882Z
tags: ["architecture", "php"]
reading_time: 20
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)** · 20 min read · 0 upvotes · 0 comments

## Summary

A PHP internals RFC thread proposing a new `Time\Duration` class for PHP 8.6, targeting 'stopwatch' or 'egg-timer' style durations to improve developer experience for timeout APIs. The class uses a seconds + nanoseconds internal representation (similar to Rust's and Java's Duration), supports constructors up to hours, and parses ISO-8601 period strings starting with 'PT'. The RFC is intentionally minimal to meet the PHP 8.6 feature freeze deadline and serve as the foundation for a modernized date/time API. Discussion covers design decisions including omitting floating-point conversion methods, namespace choice (Time vs DateTime), ISO 8601 string serialization, and whether to use the temporal_rs Rust library as a backend (rejected due to integration complexity).

## Full article

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

## Similar posts on daily.dev

- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-xvfco6jbv) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-uugjcn8ds) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-ariuhichj) · 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-yjr8kj9kx)
