Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129092 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 lists.php.net (Postfix) with ESMTPS id B76221A00BC for ; Wed, 5 Nov 2025 20:17:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1762373870; bh=wdwhj7DVT6hDR+LHsKOQLnaDW1d1meHIo+0E//yFPBQ=; h=Date:From:To:Subject:In-Reply-To:References:From; b=D3w0WNTSZgZDFJgZRb2Xb4nrR3Eh4el3ZxC0Zuhrl+x7OoQoERJesTCTpIXWBSmRS fTnn6LrTQOlH86XUglPkA59BA174+/jng+Lu8MAX2TFm0dYxl72uEuqcGvGwz2dFbO ubjMzCIegnwlW6zcI7BUGvKSYEvabwbS/9dn+yWd7w+RjsIxPeMZRfZXuuAJIwoAYS ipq1qNZ1ZE+qIhjHiH+S4ui7Fffw0bi0LIdUlUPbjQ+U2aZUoqYHMuMif5VMmnB9wp 24X8XiQXBJ53FmYmWqU/lIAG5ZcHjxcaCbp/4kNmYdDeXXC7NMOSqEIUIgKHdlFyS6 g/7Q5Oppb2hzg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 851C01801D9 for ; Wed, 5 Nov 2025 20:17:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) 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_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from fout-b6-smtp.messagingengine.com (fout-b6-smtp.messagingengine.com [202.12.124.149]) (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, 5 Nov 2025 20:17:48 +0000 (UTC) Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.stl.internal (Postfix) with ESMTP id 7B7D31D00143 for ; Wed, 5 Nov 2025 15:17:43 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Wed, 05 Nov 2025 15:17:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1762373863; x=1762460263; bh=wdwhj7DVT6hDR+LHsKOQLnaDW1d1meHIo+0E//yFPBQ=; b= Y+YaA+SVZyNuOD3o/uS51yo8R8LVQSwvbK7SDnFIBGic03oiNfl4V9qV5VugQhtr D6cgz0Ugv+yzSyPGb9ZaMw7dLzMtr9VJlz24bwVFxVWaN+aD2Z1ayRKFp+8kYwpx l7pQG11EvMZT4YOmY82aNwPmkkDkpqKyMdQAkASWeJaVlTRhKmcy6rtEEyxejMx1 oWx56qAYxh07zZKiyxG3OAkSLLIdFgvtGS2ruLs7g8a7xrHEQnPG46olBLPlObiz hZCgw9aE1nr8KiWSYrIGNAg9Un5OkFuetrfYnXcDAUfRGku91XAyHC0K9jDYs7VV YYf2PJZn7JFvQJHD9IrRVg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1762373863; x=1762460263; bh=w dwhj7DVT6hDR+LHsKOQLnaDW1d1meHIo+0E//yFPBQ=; b=ltOMbSIZlYOt7i1zD ZtWnqBUM26fkt5cL1AbEhXEJoyooL24d6K3rwj34lwismGbZDdcoU/f63RdK4Kdf J0fu/y74TYqXokTJy99pc9n6gF8PhFR4dNXmN6so6lx3sYmcvN1uN6tneSVKiB5Y 0ONECAcptor+HZ97Nrtejx0sWMlbFBrV8cDHzDrs1M3PJBxw2r0bqnlggPLlcKYt 1y5gciV9noakYd5E/6UUECqOS3xO5k07f8BSBRv0pcR7xf/XROFePC4ULap14pYH l3B91Q1iE9+DTsQIWz/C+Wo4aMoiDxgPFAQhZx7Q5rl/eFgKqF1J1rhuwiG1ybOK maPAg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddukeegkeegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpeffhffvufgfjghfkfggtgfgsehtqhhmtd dtreejnecuhfhrohhmpedftfhofigrnhcuvfhomhhmihhnshculgfkoffuohfrngdfuceo ihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqeenucggtffrrghtthgvrhhnpeehle ffteeigfevudetfedugedtudevledugeeugeelheeihfehgfdtkeevvefgleenucevlhhu shhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehimhhsohhprdhphh hpsehrfigvtgdrtghordhukhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphho uhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 5 Nov 2025 15:17:42 -0500 (EST) Date: Wed, 05 Nov 2025 20:17:42 +0000 To: internals@lists.php.net Subject: Re: [PHP-DEV] [RFC][Discussion] use construct (Block Scoping) User-Agent: K-9 Mail for Android In-Reply-To: References: Message-ID: Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 4 November 2025 19:44:40 GMT, Seifeddine Gmati wrote: >This mimics Python's context manager protocol=2E The `dispose()` method >would be called before `__destruct`, allowing objects to distinguish >between successful completion and failure=2E A clarification here: this would be equivalent to IDisposable in C#, but i= t would not be equivalent to the Context Manager protocol in Python=2E=20 The use cases which motivated them are actually quite different: C# needed= a way to handle things like pointers to unmanaged memory, so the design is= closely tied to the actual resource object cleaning up its own internal st= ate=2E Python was looking much more generally at common programming pattern= s, and a "context manager" can be separate from the resource it is managing= , or even have no associated resource at all, only "enter" and "exit" behav= iour=2E Rowan Tommins [IMSoP]