Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113262 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 11447 invoked from network); 25 Feb 2021 12:23:54 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 25 Feb 2021 12:23:54 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 795611804E2 for ; Thu, 25 Feb 2021 04:12:50 -0800 (PST) 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.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 25 Feb 2021 04:12:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1614255167; bh=5nDwa7INvCmqEs0TUnkzRStq+Oc/mv5EC7IdJyzabKA=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=P6i7YiByZzIs/Aw57FEzYltWMKBz/wdbXFaDzHGMANWguR3S/1c4RbAh8QVMoHHcy /skTwv1teGHVXkDKPGxB0lILTBObgdbUnPJJbQu1Zvx0I3mPbM6BmBLpY2TVSEv7V/ tmsOYwdkaPv1H/joPtkrZ771Zls3v1dVGpnfgIa4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.2.130] ([84.179.232.41]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mr9G2-1lZTYX2Htm-00oD70; Thu, 25 Feb 2021 13:12:47 +0100 To: Nikita Popov Cc: Marco Pivetta , David Gebler , PHP internals References: Message-ID: <629736ee-074e-8059-f60f-8700c8f55a92@gmx.de> Date: Thu, 25 Feb 2021 13:12:46 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:jZFXqTSoeZ+Utig6fcD9b3F/0B1uuXU6cuWYtHevemt4uS3OVu6 cCPqYSJykJClvo+JiFLl1SiVdoHqsrgUok8yF8rTws8xrOwTzFXyekGAMy09twUY/daUsq0 h9/TuEDMHTgc9ojOj/j8fxge1WARlyr7Xj3b3SwFwriOqRekQveKqXWeGl/wm5QCRcJ7bz4 MBdmbGfCanrEJZEfpLY6g== X-UI-Out-Filterresults: notjunk:1;V03:K0:BeQvJubmPk4=:n60RdBBmWOv7CQMw5SO9xV bheCcoiPNjs1UYYX35sxWsVFcPmA1TUznBCycbVeMASNChbMvgZ3p1HTCa0qKaVEeiwbrlNdm ZDw2/5t+cL1NwH2JEwtFjoIAOh8GiVRxPwv8wNRkP7QidWOyKPLQZd4wZZZhVNHRjT5xi/O5i A7EmaZ4PCBdSmrjp/JAYCyE9SbsgcZL9/vB7ZGYICziChlKhhnTHdGPy16DrInDBbZ+VXiyEF IHcGfFbCdwL9ZFB8ngA64o9wuh/e6MRMjZovKhn9dUej6yMN9BJr5qfJ/8mXvy9LJuAGvp1GZ oh811/8eW1XYVjDoWmVhCNPDkFVavgSiHMdI9vD30M7is+VW3MJYPbkoNEIG195vU+xxTI0Yp PJZ5tcjG3Ris2Y0WkLILRr2LzftCY/R4oDxSqHcNT4MtzUGbvcT1D0xgCl2kWWWZ2dIgK4gCe mzgY9nnKv6TDPi1YgVmuccyXPTfigDZ2X/fOPBruAqa/Va6mE/M+tQnurK7T0eBB64Vfdwvw/ XW3Jr1/r3W1ZweG+aVcl/WEgWwPgnF0jVPl9VFWolu6vXwjevuuGd7p8FugUcqc7DqXwCg+R6 OFDKbCJKguUpGggK19k1bVCRTHSaNX3rY+uMR549LFU4ozUztqkg1266OiiCk7GnJfS0j6DI5 Efa2Xig4t1q5cd/d4KqdubSJ/b/bWEFRfUFyj2M83yia6hbgli6aPw0NhaU9WZHD/pAQJIbtH AOK2pkiFMIDZ//RoDOLBKNAxgyRHt4QTxdHUzxXEE8yBYSZPzMaLFtGMShDWOaFKPxSkgLlf7 8b9NpuJwUDZbZeQ5c8e8pE0pYdqS5ZVT0YyHWGB2FdPoddi0Ka2Fe09HJq6JtHCViWVgivsjf f4cqZprFqpAABbZqnYIQ== Subject: Re: [PHP-DEV] [VOTE] fsync function From: cmbecker69@gmx.de ("Christoph M. Becker") On 25.02.2021 at 13:03, Nikita Popov wrote: > On Thu, Feb 25, 2021 at 1:01 PM Christoph M. Becker > wrote: > >> On 25.02.2021 at 12:43, Marco Pivetta wrote: >>> Hey David, >>> >>> >>> >>> On Wed, Feb 24, 2021 at 6:15 PM David Gebler >> wrote: >>> >>>> Voting is now open for 2 weeks on >> https://wiki.php.net/rfc/fsync_function >>>> >>>> Regards, >>>> David Gebler >>>> >>>> On Tue, Feb 23, 2021 at 5:15 PM David Gebler >>>> wrote: >>>> >>>>> Hi internals, >>>>> As there appear to be no objections or concerns, I intend to open >> voting >>>>> on https://wiki.php.net/rfc/fsync_function tomorrow and voting will >>>>> remain open for two weeks. >>>>> >>>>> The RFC and its implementation >>>>> >>>>> - Adds functions fsync() and fdatasync() for plain file streams on U= nix >>>>> systems. >>>>> - Adds function fsync() on Windows with fdatasync() available as an >> alias >>>>> >>>>> PR ref https://github.com/php/php-src/pull/6650 >>>> >>> >>> Just clarifying on my "NO" vote: I'm opposed to having more E_WARNING >>> raised by the language. >>> >>> We have better approaches for that: >>> >>> * exceptions >>> * union types >>> * Maybe/Either types >>> >>> I don't see a reason to introduce a warning here, and it makes the >> function >>> unusable unless some poor soul implements a library that gets rid of t= he >>> warning. >> >> Note that *this* warning is never supposed to occur in production, >> because it is a programming error to pass a wrong resource *type*. >> Rasing a warning for wrong resource types is standard behavior of >> zend_fetch_resource() (unless no resource type name is passed). I don'= t >> see why these new functions should use a non standard mechanism. >> >> Of course, in the long run resources should go away, which would resolv= e >> this issue for these functions as well. >> > > A wrong resource type will throw a TypeError as usual -- the warning is > thrown if the resource is of the correct type (stream), but does not > support sync operations. For example, if you tried to do an fsync on an > http:// stream. Ah, thanks for the correction! (I'm doing too much PHP 7, still.) > Throwing a warning in such a case is consistent with how functions for > other optional stream operations work. ACK. =2D- Christoph