Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129499 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 410F01A00BC for ; Tue, 2 Dec 2025 05:32:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1764653541; bh=IxtZfRS+OFwsm++6Jeg0peZ3J95k5BfEsV72bkShUWQ=; h=Date:Subject:To:References:From:In-Reply-To:From; b=KqRbUUMei61elTy/adn8VYWosYv00t2AVgQlv6jIsdgCoS1X1+x/cxRChqjH77NtC 34JAvzze/Md4Y0D7j9Evrhl3zvi+Gg1i2xl8Kvc5KeHeY/f4SczSZvhN/nTJjuTp+4 qx1IZhHOTlmMwzz2HilK97HBGuwfOVAjr0I/0jlElVKJt8BStnfN1tqbxYp4MO02Yt B3Lm5p67AfRwefdUOPyxvO9TttWtaYNukfArQdui71OkibVCQ7qwUBozccX2+c72HR A9JaYYKAOZ3Tg2Jk/4Zinw6wOiHyFteXU4SQl1OSHnZsxyr+b87YbTLJkzAVopEnJT NYNvEN4PhPM4A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id A6331180050 for ; Tue, 2 Dec 2025 05:32:17 +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.3 required=5.0 tests=BAYES_50,DKIM_INVALID, DKIM_SIGNED,DMARC_PASS,HTML_MESSAGE,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 mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) (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, 2 Dec 2025 05:32:17 +0000 (UTC) Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4dL8Xm3cwcz9vBm for ; Tue, 2 Dec 2025 06:32:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mabe.berlin; s=MBO0001; t=1764653528; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3+k23yDt9xdA/sGTXqXY25I6oo9ciO8XR0/ZS/yBBkk=; b=k4iz72Kfem3bup6CgkEFXb2HSxxDgXMtpd5rn6GeG9Xw7L4LYXlkxSbVfYKwsBPxLPOLTL 6mKB8SS2umCaNXMZtYWr+r5rEXlz4MJW4dDaGglDromoIJv7LZllbt1w3O9bwse2dbHm1q xklw5yvqSd6TW6lHfjkkpp6glLgGhTApzWLUQm0gK4D/1uuIT7e8Rfpoaov/byI9f/OZfP QCJFd36vmFUsuoFkMYHsm8V/nJEitumCv3iBro4DpCI3DUO44UbmWJQuNFgEjU4LRpCJWY VrpHlkLuMDxxPS3HCR6T9JqzcQDmD1cZMIFnSPTn0cKtA6Yt3mgR7VWwfxFRKA== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of marc@mabe.berlin designates 2001:67c:2050:b231:465::1 as permitted sender) smtp.mailfrom=marc@mabe.berlin Content-Type: multipart/alternative; boundary="------------xAnnU2J68U4mOVqMh0bF0Z08" Message-ID: Date: Tue, 2 Dec 2025 06:32:07 +0100 Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Subject: Re: [PHP-DEV] Possibility to include called object in exception backtrace To: internals@lists.php.net References: <6f3167c3-b6e7-4f25-8154-ce20de7d3e82@mabe.berlin> <1c04232d-5a9c-16c7-b01b-1469d566aefa@php.net> <5C76F995-1E1E-4683-842B-ACD6BB2D4785@rwec.co.uk> Content-Language: en-US In-Reply-To: <5C76F995-1E1E-4683-842B-ACD6BB2D4785@rwec.co.uk> X-Rspamd-Queue-Id: 4dL8Xm3cwcz9vBm From: marc@mabe.berlin ("Marc B.") This is a multi-part message in MIME format. --------------xAnnU2J68U4mOVqMh0bF0Z08 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Derick, On 01.12.25 12:44, Rowan Tommins [IMSoP] wrote: > On 1 December 2025 10:36:51 GMT, Derick Rethans wrote: >> I don't think that adding an INI setting (again) is a good idea. If you >> want to make this configurable, it should be an option on >> Exception::getTrace() — INI settings make applications less portable >> (even though this is a debugging option). > > A parameter on the getter would mean every exception has to capture the references just in case they're used, which would definitely be a bad idea. > > If I remember rightly, the existing INI setting for capturing parameters was added precisely so that users could turn *off* collection in production builds. > > The same reasoning applies to other debugging settings, like skipping evaluation of assertions rather than silently discarding their results. As Rowan already mentioned, adding a parameter to `getTrace()` would require every exception object to keep a reference of the called object just to make it retrievable if requested. Configuring it as INI option - it can, and should, be turned off on production environments. Also, the INI option `|zend.exception_provide_object` would be in line `||zend.exception_ignore_args` making it's use consistent with already existing behavior.| > Regards, > > Rowan Tommins > [IMSoP] Regards, Marc --------------xAnnU2J68U4mOVqMh0bF0Z08 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi Derick,

On 01.12.25 12:44, Rowan Tommins [IMSoP] wrote:
On 1 December 2025 10:36:51 GMT, Derick Rethans <derick@php.net> wrote:
I don't think that adding an INI setting (again) is a good idea. If you 
want to make this configurable, it should be an option on 
Exception::getTrace() — INI settings make applications less portable 
(even though this is a debugging option).

A parameter on the getter would mean every exception has to capture the references just in case they're used, which would definitely be a bad idea. 

If I remember rightly, the existing INI setting for capturing parameters was added precisely so that users could turn *off* collection in production builds.

The same reasoning applies to other debugging settings, like skipping evaluation of assertions rather than silently discarding their results.

As Rowan already mentioned, adding a parameter to `getTrace()` would require every exception object to keep a reference of the called object just to make it retrievable if requested.

Configuring it as INI option - it can, and should, be turned off on production environments.

Also, the INI option `zend.exception_provide_object` would be in line `zend.exception_ignore_args` making it's use consistent with already existing behavior.

Regards,

Rowan Tommins
[IMSoP]

Regards,
Marc

--------------xAnnU2J68U4mOVqMh0bF0Z08--