externals.io
Read post

[RFC] Duration class

Tim Düsterhus and Derick Rethans have proposed a new `Time\Duration` class for PHP 8.6 to represent stopwatch-style durations, primarily to improve the developer experience for timeout APIs and the new Polling API. The RFC is intentionally minimal, using a seconds+nanoseconds internal representation (similar to Rust's and Java's Duration). The mailing list discussion covers design decisions including: why the highest constructor unit is hours while internal storage uses seconds, the omission of ISO 8601 serialization and floating-point total methods for now, namespace choice (`Time` vs `DateTime`), concerns about the `fromIso8601String` method name given PHP's non-standard DATE_ISO8601 constant, whether to use `add`/`sub` vs a variadic `sum` method, and why the authors chose not to use the `temporal_rs` Rust library as a backend.

    #architecture#php
Jun 22•1h 8m read time•From externals.io
Post cover image
430 Impressions
externals.io's image
externals.io

3 Followers

•

43 Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard