Re: Allow sleep() to accept non-integer values

From: Date: Tue, 11 Aug 2020 10:39:26 +0000
Subject: Re: Allow sleep() to accept non-integer values
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-111451@lists.php.net to get a copy of this message
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. > Implemented using nanosleep which is not guaranteed to be available everywhere. Please just use usleep if you need more accuracy than seconds. Having a function that behaves differently based on different platforms is a bad idea. Changing a function to have surprising behaviour just to avoid using a different function, that is already available, is a really bad tradeoff. cheers Dan Ack

« previous php.internals (#111451) next »