Re: [PHP-DEV] Allow sleep() to accept non-integer values

2020-08-20 Thread Máté Kocsis
> > > > Again, I personally don't understand why this could bypass the RFC > > process, as multiple people have already, me included, voiced their > > disagreement with this change. > > > > This was proposed by Nikita Popov in his comment > > > > Nikita is just one of the members. If other members

Re: [PHP-DEV] Allow sleep() to accept non-integer values

2020-08-20 Thread Gabriel Caruso
On Thu, 20 Aug 2020 at 14:55, Michael Voříšek - ČVUT FEL < voris...@fel.cvut.cz> wrote: > > Again, I personally don't understand why this could bypass the RFC > process, as multiple people have already, me included, voiced their > disagreement with this change. > > This was proposed by Nikita Popo

Re: [PHP-DEV] Allow sleep() to accept non-integer values

2020-08-20 Thread Michael Voříšek - ČVUT FEL
Again, I personally don't understand why this could bypass the RFC process, as multiple people have already, me included, voiced their disagreement with this change. This was proposed by Nikita Popov in his comment Secondly this change introduces another inconsistency, why can sleep accept a

Re: [PHP-DEV] Allow sleep() to accept non-integer values

2020-08-20 Thread Gabriel Caruso
On Thu, 20 Aug 2020 at 14:16, Michael Voříšek - ČVUT FEL < voris...@fel.cvut.cz> wrote: > Hi everyone, > > thank you for your comments, based on them, I fixed these: > > - usleep is now used as a fallback as well, if interrupted, remaining > time is measured using microtime, so return value is alw

Re: [PHP-DEV] Allow sleep() to accept non-integer values

2020-08-20 Thread G. P. B.
Apologies for the double email, my client did something funcky. On Thu, 20 Aug 2020 at 14:22, G. P. B. wrote: > On Thu, 20 Aug 2020 at 14:15, Michael Voříšek - ČVUT FEL < > voris...@fel.cvut.cz> wrote: > >> Hi everyone, >> >> thank you for your comments, based on them, I fixed these: >> >> - us

Re: [PHP-DEV] Allow sleep() to accept non-integer values

2020-08-20 Thread G. P. B.
On Thu, 20 Aug 2020 at 14:15, Michael Voříšek - ČVUT FEL < voris...@fel.cvut.cz> wrote: > Hi everyone, > > thank you for your comments, based on them, I fixed these: > > - usleep is now used as a fallback as well, if interrupted, remaining > time is measured using microtime, so return value is alw

Re: [PHP-DEV] Allow sleep() to accept non-integer values

2020-08-20 Thread Michael Voříšek - ČVUT FEL
Hi everyone, thank you for your comments, based on them, I fixed these: - usleep is now used as a fallback as well, if interrupted, remaining time is measured using microtime, so return value is always available - for BC, if not interrupted, return value remains to be 0 (integer zero) No

Re: [PHP-DEV] Allow sleep() to accept non-integer values

2020-08-13 Thread twosee
> 2020年8月11日 下午6:39,Dan Ackroyd 写道: > > Michael Voříšek wrote: > >> Another reason is that sleep(0.1); is silently accepted now (even with > strict types enabled), > > That appears to not be true: https://3v4l.org/7YbqX > > Rowan wrote: >> Unless there are problems with the implementation,

Re: [PHP-DEV] Allow sleep() to accept non-integer values

2020-08-11 Thread Matteo Beccati
Hi Michael, On 11/08/2020 12:39, Dan Ackroyd wrote: > Changing a function to have surprising behaviour just to avoid using a > different function, that is already available, is a really bad > tradeoff. I agree. function mysleep(float $s): void { usleep($s * 100); } You're welcome ;-)

Re: [PHP-DEV] Allow sleep() to accept non-integer values

2020-08-11 Thread Christoph M. Becker
On 11.08.2020 at 10:53, Rowan Tommins wrote: > Unless there are problems with the implementation, this seems like a > straight-forward win. Not necessarily a problem, but it has to be considered that POSIX mandates that nanosleep() shall fail, if "the rqtp argument specified a nanosecond value […

Re: [PHP-DEV] Allow sleep() to accept non-integer values

2020-08-11 Thread Dan Ackroyd
Björn Larsson wrote: > Given this unexpected behaviour, one could almost see it as a bug. This isn't a suddenly noticed new bug. That code has worked like that since the sleep function was committed twenty-two years ago or for five years since the release of PHP 7 and the weak/strict RFC continued

Re: [PHP-DEV] Allow sleep() to accept non-integer values

2020-08-11 Thread G. P. B.
On Tue, 11 Aug 2020 at 13:03, Michael Voříšek - ČVUT FEL < voris...@fel.cvut.cz> wrote: > > Another reason is that sleep(0.1); is silently accepted now (even with > strict types enabled), > > > > That appears to not be true: https://3v4l.org/7YbqX > > corrected, should be "without strict types ena

Re: [PHP-DEV] Allow sleep() to accept non-integer values

2020-08-11 Thread Michael Voříšek - ČVUT FEL
Another reason is that sleep(0.1); is silently accepted now (even with strict types enabled), That appears to not be true: https://3v4l.org/7YbqX corrected, should be "without strict types enabled" - https://3v4l.org/A2olN "even with strict type enabled" statement in BC section remains valid

Re: [PHP-DEV] Allow sleep() to accept non-integer values

2020-08-11 Thread Björn Larsson
Den 2020-08-11 kl. 10:53, skrev Rowan Tommins: On Tue, 11 Aug 2020 at 08:31, Michael Voříšek - ČVUT FEL < voris...@fel.cvut.cz> wrote: I am the author of https://github.com/php/php-src/pull/5961 , please provide feedback. This idea makes a lot of sense to me as a user (I'll leave comments o

Re: [PHP-DEV] Allow sleep() to accept non-integer values

2020-08-11 Thread Dan Ackroyd
Michael Voříšek wrote: > Another reason is that sleep(0.1); is silently accepted now (even with strict types enabled), That appears to not be true: https://3v4l.org/7YbqX Rowan wrote: > Unless there are problems with the implementation, this seems like a straight-forward win. >From the PR. > Im

Re: [PHP-DEV] Allow sleep() to accept non-integer values

2020-08-11 Thread Rowan Tommins
On Tue, 11 Aug 2020 at 08:31, Michael Voříšek - ČVUT FEL < voris...@fel.cvut.cz> wrote: > I am the author of https://github.com/php/php-src/pull/5961 , please > provide feedback. > This idea makes a lot of sense to me as a user (I'll leave comments on the implementation to those with more C expe

[PHP-DEV] Allow sleep() to accept non-integer values

2020-08-11 Thread Michael Voříšek - ČVUT FEL
Hi everyone, I am the author of https://github.com/php/php-src/pull/5961 , please provide feedback. All details should be in the description, also, please advise if we can consider it as a small change not requiring RFC as Nikita proposed in his comment. With kind regards / Mit freundliche