Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121760 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 69546 invoked from network); 22 Nov 2023 18:09:30 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 22 Nov 2023 18:09:30 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4E55F180043 for ; Wed, 22 Nov 2023 10:09:32 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from forward502c.mail.yandex.net (forward502c.mail.yandex.net [178.154.239.210]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 22 Nov 2023 10:09:31 -0800 (PST) Received: from mail-nwsmtp-smtp-production-main-92.myt.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-92.myt.yp-c.yandex.net [IPv6:2a02:6b8:c12:248e:0:640:3a58:0]) by forward502c.mail.yandex.net (Yandex) with ESMTP id F3E326177D for ; Wed, 22 Nov 2023 21:09:24 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-92.myt.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id O9TAOX9OheA0-aUlXgCpy; Wed, 22 Nov 2023 21:09:24 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=php.watch; s=mail; t=1700676564; bh=f4PGSMsHIWSMBKItbbDsbMEHC8nRGA2JPhszOt2/3ag=; h=To:Subject:Message-ID:References:Date:From:In-Reply-To:Cc; b=S7/HzCDgk10HCO+zJBJFytz0eWy3amyC9lMCtDkKtbhaV95D+pDk9pZHkMRuEYfne xMgLVjiGMS9DOsjelIb0LQkIdlNIOYK99R+hG2MIeV+1EvvKL3FsW4SmEcTfjWN46a fiX81EdtSrNTJkowOi4tUrCpqaw5tZdlQ4O0aDD4= Authentication-Results: mail-nwsmtp-smtp-production-main-92.myt.yp-c.yandex.net; dkim=pass header.i=@php.watch Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-50abb83866bso1205417e87.3 for ; Wed, 22 Nov 2023 10:09:24 -0800 (PST) X-Gm-Message-State: AOJu0Yya1RwmYcvqGDAhVls/RMLIhG/cxwScQ4gYRwE9zW2BYHfw6WT6 24YkRPuN04tc0hTs+5ipuYhiIQxB6DtN4Hh1cwA= X-Google-Smtp-Source: AGHT+IGXCquIpWwS/sludrL0nfhLFF98agylKiDXuexWR/qPOctbmveR4DeUIEzN3J2HxHBCd+hmSMgqF0yJvcktrE0= X-Received: by 2002:ac2:43b1:0:b0:503:2deb:bbc1 with SMTP id t17-20020ac243b1000000b005032debbbc1mr1962834lfl.22.1700676563895; Wed, 22 Nov 2023 10:09:23 -0800 (PST) MIME-Version: 1.0 References: <04DC3709-3B46-41C0-976E-E6AB28BC0D34@edison.tech> In-Reply-To: Date: Thu, 23 Nov 2023 01:08:56 +0700 X-Gmail-Original-Message-ID: Message-ID: To: "G. P. B." Cc: Mike Schinkel , Jakub Zelenka , =?UTF-8?B?TcOhdMOpIEtvY3Npcw==?= , PHP Internals List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] [Discussion] Resource to object conversion From: ayesh@php.watch (Ayesh Karunaratne) > More importantly, it is possible to write cross compatible code, even > without changing anything about is_resource(), if we convert streams to > opaque objects. > It might be tedious and one might need to have redundant instanceof check= s > with is_resource() if one does not want to check for a false return, or > duplicate checks for closed resources. > Extensions like GD, IMAP, Curl, and FTP were once very "resource heavy", but they already received this migration with next to none disruptions. Shameless plug here (https://php.watch/articles/resource-object) where I track the progress. As these changes were merged in the last couple years, I spent a few hours grepping the Composer top 1000 packages. There were not that many `is_resource` checks, and it was quite easy and straightforward to update them to account for the class objects. I'm supportive of our trajectory so far by slowly but steadily moving resource objects to class objects. I also support that we do not modify `is_resource` to mark resource class objects as a resource. I really look forward to the day that we remove `is_resource` and kill the final resource object in PHP =F0=9F=A5=BA.