On Sat, Nov 4, 2023 at 11:40 AM Tim Düsterhus <t...@bastelstu.be> wrote:
> Hi > > On 11/3/23 21:51, Jakub Zelenka wrote: > >> The main reason I would like to see this deprecated is not the fact that > >> it's returning a less precise value compared to getrusage, but rather > >> because it's returning a value that cannot be interpreted in any way > >> from pure PHP. > > > > So if the constant is added, which is trivial, then the only reason left > is > > that it's returning slightly less precise value and maybe slightly harder > > way to interpret it, right? If so, then I don't think this is enough to > > break BC. It would be much better done using documentation where we > should > > also add a note about the new constant. > > There is no real backwards-compatibility break, because the function was > not correctly usable in the first place. This means that anyone who > currently uses the function already has broken code. > > Well we don't really know how users use that function. If someone takes a look, they can see that the time is not in milliseconds. It basically just uses different unit so it might still be useful for comparison of times if for example it is logged somewhere and then compared or even used as a measure (e.g. for some dashboards). So I certainly still see some valid use cases here. I have just quickly checked docs and it seems to me that it offers some extra info compare to getrusage. Specifically it differentiate between times for current process only and times for process and children. That might be potentially useful for someone using pcntl_fork and similar. In addition it returns total number of ticks from reboot which might have some use cases as well. I'm not sure how this could be replaced by just getrusage. Do I miss anything? Regards Jakub