Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113138 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 71647 invoked from network); 11 Feb 2021 12:41:41 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 11 Feb 2021 12:41:41 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4AF181804D0 for ; Thu, 11 Feb 2021 04:27:06 -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.20]) (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, 11 Feb 2021 04:27:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1613046421; bh=oIf/aQNL5ex7kYQgauBCI8bALe06j22d2/5bjx5dBgA=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=RSrC0mSx+623MNCAYFAFWVE3nVIfMR2zEv+0YrZiD03AsR9O6htqB8wAeWVvSsTLX na4p7DHPrA3L3SbHj0InjAI0Fidbpc1gDuOh4gyxIu4xUOt6fkOQE1foPfIR8JbYl8 AWvAvjFoT6aphccXW72tsm2raUCQwRDN3Q2sVRiw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.2.130] ([91.8.163.75]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mirng-1lmpiy3jrY-00etxk; Thu, 11 Feb 2021 13:27:00 +0100 To: Brent Roose , PHP Internals References: Message-ID: <41ae6041-676a-2945-9580-e25bcb96a19b@gmx.de> Date: Thu, 11 Feb 2021 13:27:00 +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:vRIfCUBBhEW4Hy12/6PL2iXFRSHfFReRIE26kdrCUXscPgJerGZ gPYhQk795zIdY1+nNtdBK92QF/6TmtOY3mE9l3Hl5ZBgLjWp9IcqzMVZ9d/IvMjOEdJMSJu 0gOsYK0ppzt6SL0mR3RGiJCO+Y/4Kd8zQvn0bV4WSAFdN+2xk3/ZMkiVGOrQO9EWFT6UwGb 3AD06AWOueBXq+lqbHkoA== X-UI-Out-Filterresults: notjunk:1;V03:K0:NbgwfMlxeXs=:yg+dXjZlhIJQy6mFuPRb/m PhybDX6IoNQnNCOCsXQpnfA+7IFpmRF3YYrSyoX7b49RWo+6gTqeakYrvdd6jlyjAzNSV4mQU kYoenaSN0Tq8hbNDxPIL61VMdzsxBn2AdFrgaAX/FV1xS2L6O1ctuIi67AN5B/ZXZBgXu0LEZ FrbrCTtJrp9e3dpwR1SmVQein4Esnn37uC3Nh7RqlaB6VjpK8DxUFxgVhlGCOFSXnPAq7Rr5t 96b4wV8jhH6AMsBsOvwxUZD/TC3K/mjWI5MAQbFx0OUOV/VthKbI1M3HigCy0Bjf85H0tCPnH Xvt5d2XlhLAOAduFGz1rOZt0SGTXJndXX7UmIUB0Tl/OZTZ2GJxWzWICwVGDePxpYBmHWEySv yNxSlf4I1ndCnATmwYauzBl8xAGCiaXFWeeQpQfPcIWv4+aFTEP1MQCTwWcrPFzwvr0HvIIsT o+n2Dzw8EX9kZS3G4OFHEtcj/43z7VIhpfXwUqvBGh1cgGetRKWlOKsv9SmflO6qW4HX3VbHn PjHvr2U/Hko5MHh/gTnLMQTogb2OdtOKajH3PilpD64GtE9AthdUtup3Oot9jitBm2JbqAcnC x/tp7ZVjo39KfJzBQV8/n3X9H6aujDAEwBO0HnpiMVQzoZlUGxVOxDMOPGLxvJSBC0apnb0gC jD5eFVng3CLMWj5XdNb41SB2lsOPKDw+xLXUn8F3IvcYyvOzwnNUx19BAHnzN8X2UnWxFdfkm ed8bkU/PQ1dZXuYs/LTEq1scwlk4L33DRRr2XMLxxREyOrhrLE++z33owBwQf+1UhiuX+IlIu zydQwFVlSgMulr/Qu1Y6Ycd3v4bZth+14CoKa0UjfUfb2miRkmcN+x1+ZENzme2+erhl69i2t Q9fKozYNs8j3lbQFIa+w== Subject: Re: Changes to finfo and imap functions From: cmbecker69@gmx.de ("Christoph M. Becker") On 11.02.2021 at 05:57, Brent Roose wrote: > The chagelog for PHP 8.1 lists the two following changes: > > > - Fileinfo: > . The fileinfo functions now accept and return, respectively, finfo ob= jects > instead of resources. > > - IMAP: > . The IMAP functions now accept and return, respectively, IMAPConnecti= on objects > instead of resources. > > I suppose these changes are part of the move away from "resources everyw= here" ? I was wondering whether these function will still accept resource = objects in PHP 8, or if support for them is completely removed. > > I tried searching externals.io for a previous dis= cussion but could only find https://externals.io/message/111297#111298 Yes, these changes fall under the general resource to object conversion (which is IMO generally a very good move), and the respective resources are completely removed. However, it seems that the incompatibility is not only wrt. is_resource() checks, which can easily be resolved (and may not be an issue for some code bases), but also regarding conversion to int. It might be sensible to implement cast_object handlers for those classes, which may be deprecated. The SSH2 extension would need particular attention in this regard, since it deliberately uses resource to int/string conversion for its wrappers, and even looks up the resources from the regular_list[1]. [1] =2D- Christoph