Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:111452 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 19172 invoked from network); 11 Aug 2020 11:44:39 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Aug 2020 11:44:39 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CAC8A18050B for ; Tue, 11 Aug 2020 03:44:02 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from v-smtpout1.han.skanova.net (v-smtpout1.han.skanova.net [81.236.60.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 11 Aug 2020 03:44:01 -0700 (PDT) Received: from [192.168.7.8] ([213.64.245.126]) by cmsmtp with ESMTPA id 5Rl9k7nQOgCsq5Rl9kXDXW; Tue, 11 Aug 2020 12:43:59 +0200 To: =?UTF-8?B?TWljaGFlbCBWb8WZw63FoWVrIC0gxIxWVVQgRkVM?= , Rowan Tommins References: <6cfb77d4d511b5c591e7d7b5cc80199955123b2cd4276a5bca2327e4b02942db@mahalux.com> Cc: PHP internals Message-ID: <4a6d97c1-28e8-c6cb-e985-d32c5d056ec0@telia.com> Date: Tue, 11 Aug 2020 12:43:59 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-CMAE-Envelope: MS4wfELxaX2EWTMzLu573N3/twspvIz07tbcT77Y1gIpeaPMPWasqBcyiuZyei3GQa4//owYdI79HlzrIUivRoNqnf94JQGw08898Y0TyekKMgkmAortNnDK bjuiqyFn458yG0LVJKcqcLVeawvr2xWKSSI2ClyU9325ffE4ll4y1gXOdI8CbftpP/QoN2008DZVXt7oqeJRRU/U9eN9vZZeW7Rw0mTHNUV6Gd9Uf2RfbkjU kRG3fFM6jJT1cu4cwghzUw== Subject: Re: [PHP-DEV] Allow sleep() to accept non-integer values From: bjorn.x.larsson@telia.com (=?UTF-8?Q?Bj=c3=b6rn_Larsson?=) Den 2020-08-11 kl. 10:53, skrev Rowan Tommins: > On Tue, 11 Aug 2020 at 08:31, Michael Voříšek - ČVUT FEL < > vorismi3@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 experience). > > I'm pretty sure I've accidentally written things like "sleep(1.5)" in the > past, and think there is a strong argument for changing something here: > >> Another reason is that sleep(0.1); is silently accepted now (even with > strict types enabled), but the input is casted to 0 and thus producing > unexpected behaviour if the user is not aware of the current method > prototype. > > Unless there are problems with the implementation, this seems like a > straight-forward win. > > Regards, Given this unexpected behaviour, one could almost see it as a bug. I think it's worth considering if this also should be fixed in 8.0 or even earlier ;-) So good to hear the RM view on this. r//Björn L