Re: Deprecate posix_times

From: Date: Wed, 18 Oct 2023 13:00:23 +0000
Subject: Re: Deprecate posix_times
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-121388@lists.php.net to get a copy of this message
Hi, On Tue, Oct 17, 2023 at 6:39 PM Daniil Gentili <daniil@daniil.it> wrote: > Hi everyone, > > I would like to submit an RFC (and related PR) to deprecate posix_times > for PHP 8.4, removing it for PHP 9. > The times() is defined by POSIX and I don't see a reason why it couldn't be exposed even though there is a better alternative. I think posix extension should just expose posix defined functions and it is thus a low level extension. > > There are multiple reasons to deprecate this function: > > 1) > > The values which times(2) returns are expressed as the number of clock > ticks elapsed since the process was started: the frequency of the > aforementioned clock varies from platform to platform, and PHP does not > expose the sysconf(2) function, which is what should be used to fetch > the clock frequency, invoking sysconf(_SC_CLK_TCK). > > I think the only thing that is needed is to expose _SC_CLK_TCK as POSIX_SC_CLK_TCK and add a note to docs about it in the same way how this is documented for the C counterpart. Cheers Jakub

« previous php.internals (#121388) next »