Re: [RFC] Duration class
| From: | Tim Düsterhus | Date: | Sat, 20 Jun 2026 11:52:16 +0000 |
| Subject: | Re: [RFC] Duration class | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-131422@lists.php.net to get a copy of this message | ||
Hi
Am 2026-06-20 13:45, schrieb ignace nyamagana butera:
if no argument is given I would expect an ArgumentCountError to be thrown just like with array_sum.This statement is not accurate (it's also not a recent change: https://3v4l.org/Ia8Mc#v):
php > var_dump(array_sum([]));
int(0)
But following the implied argument, Duration::fromSeconds(0) would be the expected answer. I'll discuss this with Derick.
Best regards
Tim Düsterhus