Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130707 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 4377D1A00BC for ; Wed, 29 Apr 2026 13:15:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1777468529; bh=KAkEFKCnxK1SJJHfW0Q9t22bPO2DZClYlo59/uyGAtw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ngxiLWpfAvqGCCmh9IURcWLQvHiZB1iuR+gJGYpas20StClst3FgzyxCMiDPh0X0Y 77aI6rPiQXxonzyAJ3cO0TI2hO/hiWVTHtXg9I04sBqgaNkNlYfg2mltZJ6vV3OVb+ 1L5FssMjg3jbK82hLxV/sW/arVgembuZ7KF9VqqvmIMZzt47jJdJkEL4xbVNM3iWCL KWTE3vXUy/KAH4xKk9Y1rQrF4kOJJVNz+7d76Ix+St6MCzFoxWvmwlQ65KQ6W7+4nb AphdJnQYoi2TDslmX1Oavdxj7GahqakTEIf/DmCNqkLZDSpaago85kw7176WrtYq0n 28goaBO0q0Xaw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id ADCBE180048 for ; Wed, 29 Apr 2026 13:15:28 +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=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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, 29 Apr 2026 13:15:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1777468520; bh=F6L+VL5L6PrZKwg/b0sA8E9uMGmamyBh3MT4S2CVDe8=; h=MIME-Version:Date:From:To:Cc:Subject:In-Reply-To:References: Message-ID:Content-Type:from:to:cc:subject:message-id; b=A5pr0mylQ3wreeQs/NszxofMZGz4yLcV8kZ/KnqRuf8KIT/qcjffBM23wGTHa5xjz oWc17dWUAPM5113cvYwVGup2ZPWEYnsjmRPql/plGr6exbR4lr3x2K6+2KJ6konzJq ecO5frPhT7k0QBK3jpqmb56X3zWpD5uKOLRxXG7GYRAaOWTDT4ci/lOgL9NB6QhJCz Qil56OCYHCtsCGZ+W7uTFEN4CajvMydjvnJjq8YLWnYzgR4/0AG9m/e3/yCL5AcyRw qThYaNYaDVJUVvUkVp51xoIg1vAjhlRTISfHTR+pVEBWjzyx9UImNJpXRLh8FjqCef WFgkMOiYyY4GQ== Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Date: Wed, 29 Apr 2026 15:15:20 +0200 To: Larry Garfield Cc: php internals Subject: Re: [PHP-DEV] [RFC] Context Managers In-Reply-To: <3b2b863d-d179-40c9-ad26-8605e854a331@app.fastmail.com> References: <4985896b-c80a-4302-912e-9f572a260fb5@app.fastmail.com> <88716CA9-38E4-45CA-9471-2D8928CF4DE2@rwec.co.uk> <3b2b863d-d179-40c9-ad26-8605e854a331@app.fastmail.com> Message-ID: <018193fa191faf95bb065a35a9a4d2a3@bastelstu.be> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi Am 2026-04-22 20:28, schrieb Larry Garfield: > ## Ways of handling a single method's returns > > Possible ways to do so off the top of my head, in no particular order: I don't currently have the time to digest this email in detail, but I wanted to mention an alternative you didn't before I forget: Making the exception an in-out parameter. That would be functionally similar to a return value, but more strongly default to “don't make a change”, because “doing nothing” will just work. i.e. public function exitContext(?\Throwable &$e): void { // Assign null to suppress. $e = null; } Best regards Tim Düsterhus