Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125669 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 247B01A00BD for ; Tue, 24 Sep 2024 17:21:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1727198623; bh=CWYMTrZDuD1hoC3qJwijlRl1w6glxGwFTR0KpAn5LEg=; h=Date:To:From:Cc:Subject:In-Reply-To:References:From; b=BdPagA+wi3M2QTnluSgnff+tq5TMBnpxzM4vZO0AScrtPfQBLfGqT/b86BmMgXKLk 4F6/zqPE4m6gyH1iOxDQe6dtwx88BPiGXUoNk7ZoTwfNuYbqL5zswAVMriFpXgLyE5 e761sx4AsUswgthUyIPmip2PHRuT//hRDOq/yvX4IRQLM3cxPuIR5IzP6gbIZcjmSg qs8Ypx7HFbMmpHmWvyefZRv079CBJv8hSvbyEQMF5zROsuxiPvARr6MLR5v22fe4fM VbQFR++FzRFd3Z81lakI/xWQ4yJc+QzhshXoaB0yKjROUzntCaCSFuWndprXo/WoCX xfEDcd6ivBNCg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2168F180078 for ; Tue, 24 Sep 2024 17:23:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-4317.proton.ch (mail-4317.proton.ch [185.70.43.17]) (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, 24 Sep 2024 17:23:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gpb.moe; s=protonmail2; t=1727198490; x=1727457690; bh=CWYMTrZDuD1hoC3qJwijlRl1w6glxGwFTR0KpAn5LEg=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=uKaetPxz9ysMJF24Q2AJetXnkm/UndJ34bTqIyjTE87mQ+9fGftqb78JaXUk2TnQy QsMHxWC0FfBcMtN42/66td4SmrdIjGxwFVJH4l029Bh40ttbaD6heY+ZvdLwhDAJZK Qkvd19LwHZX4bXTBELhiixGSuvWACK5Fjj3bxLmYruUtA52F8ygncFbA8Tfs8nNOe7 adaSgTASbPUlLjWdOKDuVmofRjt+Si+YYjjcBAbL/0dq6/ZSIIYv0nvacZYi0asVGf RtHy3leGLbCcQx8wjclfJQRupTgFojofqnOSH70UxooPHceolu7w1q5dnfPmIpfb3q EMR2vbdBuM0zg== Date: Tue, 24 Sep 2024 17:21:25 +0000 To: "Christoph M. Becker" Cc: PHP internals Subject: Re: [PHP-DEV] [RFC] Warn on conversions from resource to string Message-ID: In-Reply-To: <8de40002-1b2c-4baa-bbcf-997780e8a6ac@gmx.de> References: <8de40002-1b2c-4baa-bbcf-997780e8a6ac@gmx.de> Feedback-ID: 96993444:user:proton X-Pm-Message-ID: 604a789e851d46f1ad17d78b4eeb39afe79dbb93 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: internals@gpb.moe ("Gina P. Banyard") On Tuesday, 24 September 2024 at 14:24, Christoph M. Becker wrote: > On 24.09.2024 at 14:18, Gina P. Banyard wrote: >=20 > > I would like to propose a short RFC about warning on conversions from r= esources to strings, > > similar to what a conversion from array to string does. > >=20 > > Let me know what you think about it: > > https://wiki.php.net/rfc/warn-resource-to-string >=20 >=20 > The ssh2 wrappers[1] used to use this "feature". I'm not sure whether > there is another way to accomplish the same now. If not, that should > probably be done prior to emitting a warning for the resource to string > conversion. >=20 > [1] https://www.php.net/manual/en/wrappers.ssh2.php I guess that it could always use the integer representation of the resource= . Or, more sensibly, be converted to an opaque object that implements a __toS= tring() method. I have encountered some other issues in the engine exposed by this conversi= on, the biggest one being array_diff/array_intersect, so I could also spend som= e time working on that extension. Best regards, Gina P. Banyard