<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/rfc-duration-class-1raffhvsp" -->

---
title: [RFC] Duration class | daily.dev
description: PHP internals discussion thread covering a proposed RFC to introduce a new `Time\Duration` class in PHP 8.6. The class is designed to represent stopwatch-style...
canonical: https://daily.dev/posts/rfc-duration-class-1raffhvsp
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: [RFC] Duration class | daily.dev
og:description: PHP internals discussion thread covering a proposed RFC to introduce a new `Time\Duration` class in PHP 8.6. The class is designed to represent stopwatch-style...
og:url: https://daily.dev/posts/rfc-duration-class-1raffhvsp
og:image: https://api.daily.dev/og/posts/1RAfFhvSP.png
og:image:alt: [RFC] Duration class
og:image:width: 1200
og:image:height: 630
og:locale: 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)** · 96 min read · 0 upvotes · 0 comments

## Summary

PHP internals discussion thread covering 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) with nanosecond precision, stored internally as a seconds+nanoseconds pair. It targets the new Polling API already in PHP 8.6 and is intended as the first step toward a modernized date/time API. The thread covers design decisions including: why the highest constructor unit is hours while internal representation uses seconds; why ISO 8601 serialization is deferred; why floating-point total methods are excluded for now due to precision concerns; namespace choice (`Time` vs `DateTime`); the `fromIso8601String` method accepting only PT-prefixed period strings; and debate over `add`/`sub` vs a variadic `sum` method. The authors explicitly rejected using the Rust `temporal_rs` library, citing API design complexity and Zend Engine integration challenges.

## Full article

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

## Similar posts on daily.dev

- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-6uiyzwcpa) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-k3vcw9wkg) · externals.io · 0 upvotes · 0 comments
- [\[RFC\] Duration class](https://daily.dev/posts/rfc-duration-class-xax48upgz) · externals.io · 0 upvotes · 0 comments
- [\[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-rtajzuwil) · 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-1raffhvsp)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"[RFC] Duration class","url":"https://daily.dev/posts/rfc-duration-class-1raffhvsp","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/rfc-duration-class-1raffhvsp"},"datePublished":"2026-07-01T18:28:46.763Z","dateModified":"2026-07-01T18:29:11.016Z","description":"PHP internals discussion thread covering a proposed RFC to introduce a new `Time\\Duration` class in PHP 8.6. The class is designed to represent stopwatch-style...","image":"https://media.daily.dev/image/upload/s--2-1xRawN--/f_auto/v1722860399/public/Placeholder%2011","thumbnailUrl":"https://media.daily.dev/image/upload/s--2-1xRawN--/f_auto/v1722860399/public/Placeholder%2011","isAccessibleForFree":true,"articleSection":"externals.io","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"externals.io","logo":"https://media.daily.dev/image/upload/s--9i0zxASK--/f_auto,q_auto/v1780213616/logos/externals?_a=BAMAMiWQ0","url":"https://daily.dev/sources/externals"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/rfc-duration-class-1raffhvsp","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"architecture,php","timeRequired":"PT96M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"externals.io","item":"https://daily.dev/sources/externals"},{"@type":"ListItem","position":3,"name":"[RFC] Duration class"}]}
```

