---
title: "[RFC] Duration class"
url: https://daily.dev/posts/rfc-duration-class-kwojmaanm
source_url: https://externals.io/message/131436
type: article
source: "externals.io"
published: 2026-06-21T09:30:55.257Z
updated: 2026-06-21T09:31:19.227Z
tags: ["architecture", "php"]
reading_time: 35
upvotes: 1
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)** · 35 min read · 1 upvotes · 0 comments

## Summary

PHP internals mailing list discussion of a proposed RFC to add a `Time\Duration` class to PHP 8.6. The class would represent stopwatch/egg-timer style durations (not calendar periods) using a seconds+nanoseconds internal representation, targeting timeout APIs and the new Polling API. The RFC is intentionally minimal to meet the PHP 8.6 feature freeze deadline and serve as the foundation for a broader modernized date/time API. Discussion covers design decisions including: why the highest constructor unit is hours while internal storage uses seconds, omission of ISO 8601 serialization and floating-point total methods for now, namespace choice (`Time` vs `DateTime`), whether to use `add`/`sub` vs a variadic `sum` method, and why the JavaScript Temporal/temporal_rs library was not adopted as-is due to PHP's different type system and Zend Engine integration concerns.

## Full article

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

## Similar posts on daily.dev

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