Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121748 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 4819 invoked from network); 21 Nov 2023 21:43:01 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 21 Nov 2023 21:43:01 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AAA33180049 for ; Tue, 21 Nov 2023 13:43:04 -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.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (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 ; Tue, 21 Nov 2023 13:43:04 -0800 (PST) Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-5437d60fb7aso8798189a12.3 for ; Tue, 21 Nov 2023 13:43:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700602979; x=1701207779; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=eiwhWZDfv9Hty+VlqOoQRK6PDq8MxPKOgL4l9aLUHPo=; b=jW+BFyboFEFvxULZOcB743UmIMtyIspYCgQ7Z1LgzhKSdBopIjIqpODVdpa+dcruyd 0w95aLYQp98gsJ00MfPvV3Q9DMV7fJvR8V300WxGmIOovnlr+IeHxIxR9E1vxmX7rp1f LMiKA2hnotBcMY4hIlDJFkFuHMn6d3/DMbJyEeGdraMWDu6/UXrsFMdRe6jUi9pjQFiW a0L5JAyT2rwxPZXd+aQmvEs+vHL32VkFmLlYgNk5AKNkxBM3oLAThG1n77V7W/2lwt2c YxHxCkLhayna0/OvRSmTGn787P8q6/cZIh7pUZYRPEkpaMVaMduUZwp/fVIwz5T8juBf kb+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700602979; x=1701207779; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=eiwhWZDfv9Hty+VlqOoQRK6PDq8MxPKOgL4l9aLUHPo=; b=LusNIHRdHnBEaPmTcrP9eRMUJSGD9tn/lZtpn6nbkxm4xOydLXHRK6Zx9ZDt0XVYN0 P+2pw/xyDkSUcaLGYyu4XWOvKJPggyn0q7qO6zY/XBEbma8HHoeKzpDt+IvZ61lAHyzJ UXgdwTTfSd2jIOCdww/iaEAa+8N/BypAsuVDJxl/H1VSTx87+yxV9neiDMrH/L3wDiLo cAzN96eqGz+cGwIojcuIAiod+qls63oewccMuzODg0EOag3l+Fz1CYt7HTdrtYkPm9vX caRd/F0nBV+husrLGKMBFkHGMbVv21L8Rt7NusVWyEZNUq5w8UKdKuz1gAsg9Akkij0V H9ug== X-Gm-Message-State: AOJu0YxQDvt3Nf0MHxJ9jF7NzIrjvAx0jrxSVsDtK4Yiv34lg8dsAzFq 48ycMRUi26aqrjw8ixhWsC7ZUT4sl41COm7rGTqq/R4knV0= X-Google-Smtp-Source: AGHT+IGj/c1izHEJWX8o4mKpbkxEr4qFLUqafDr9ICJdr0AJpWm3md7ex99IiySoJrL1FVPVjqjL9PInRzn+TafmanY= X-Received: by 2002:aa7:c2c5:0:b0:544:55c3:ccf9 with SMTP id m5-20020aa7c2c5000000b0054455c3ccf9mr435877edp.22.1700602979122; Tue, 21 Nov 2023 13:42:59 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 21 Nov 2023 22:42:47 +0100 Message-ID: To: Philip Hofstetter Cc: Jakub Zelenka , PHP Internals List Content-Type: multipart/alternative; boundary="000000000000798405060ab07c92" Subject: Re: [PHP-DEV] [RFC] [Discussion] Resource to object conversion From: kocsismate90@gmail.com (=?UTF-8?B?TcOhdMOpIEtvY3Npcw==?=) --000000000000798405060ab07c92 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Derick, Jakub, Phiip > Did you do an analyses as to how much either of these changes could break > anything? I updated the RFC with some impact analysis. The numbers support my hypothesis that the conversion of auxiliary stream resources would cause hardly any BC break - at least in case of the top 2000 PHP packages. That's why I believe we can migrate them separately from the primary ones, which are used much more often. I wonder whether it was previously discussed to have all these converted > objects implement a `Resource` interface and have `is_resource()` check f= or > that. > Yes, the RFC links two threads about this topic: https://externals.io/message/116127 and https://externals.io/message/104361#104369. Even though there's a clear interest in changing how is_resource() works, doing so would bring us to a minefield... Please could you add a separate vote for primary streams if the resource to > object conversion should be done at all (requiring 2/3 votes to be > accepted). I will personally vote against this if there is no is_resource change as I > think it's just too big BC break even for 9.0 - it will likely require > massive update of many code bases. Yes, I added the option. > Both the function and maybe also the interface could then also be marked > as deprecated, but it would allow for a much more painless transition. > While I would love to see resources go altogether, deprecating is_resource() is way too early. Even if php-src itself manages to sunset all the built-in resources, there will still be lots of third party extensions which will still rely on them. Personally, I=E2=80=99m now relying on psalm to detect such issues, so if I= had a > vote I would selfishly vote yes anyways, but still: for those without > static analysis, > this would IMHO make things much easier. > Yeah, using static analysis should be mandatory for mission critical systems, since these tools can easily detect issues like wrong is_resource() checks. However, I acknowledge that doing so is not always possible due to some constraints (i.e. budget limits). Fortunately, the possible issues caused by resource to object conversions are usually not too difficult to find out. For example, in case of the Process resource, one has to search for all proc_open() invocations, and check whether the return values are correctly checked. According to my experience, the is_resource() checks are usually very close to the creation of resources, so they can be fixed easily when needed. Regards, M=C3=A1t=C3=A9 --000000000000798405060ab07c92--