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 (seconds + nanoseconds internally) for use in timeout APIs, particularly the new Polling API. The RFC is intentionally minimal, targeting correctness and forward compatibility. Discussion covers design decisions including the highest supported unit (hours), omission of ISO 8601 serialization and floating-point methods for now, namespace choice (`Time` vs `DateTime`), whether to use the temporal_rs Rust library, and API method naming (`add`/`sub` vs a variadic `sum` method).

36m read timeFrom externals.io
Post cover image
344 Impressions