Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129607 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 4F31B1A00BC for ; Sun, 14 Dec 2025 07:58:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1765699086; bh=cwqAhe4khD1qY14lMi3QIeHNWXq+bGLkOtXi0iXzQyo=; h=Date:Subject:To:References:From:In-Reply-To:From; b=Oh6BKCmyY8l7Uh1NmJJRx0fQn0oqsHutLwArcjU/AHLd0HRBuRWxN3pHE9XQm90rN 7G/lBiiNjFJUuIzRW7B2lCa6sN1ghs/JCHiKLaYhdSJyxfI57TGmiaNIluEGF7EcyU 3bx7djyXeJ1ybfoXBfc6fYFV2cu2WSwAKZlqibSDslFKolbAr7mvTKPyugGdF85Lqc I9nlJpdjsCa0/3QfLqeteETNQczCLJHNGk/snofG35+vwgyOH5XdFdToWeszOglQpn +Rf99fbSMFrfY1fYGR7Sl7b+sbbpodtdTvEN1YAzEpuySf4tbKbca3syJRioPrFHsZ aE92qBEliLXQg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8C3DD18002F for ; Sun, 14 Dec 2025 07:58:02 +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.9 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,T_SPF_TEMPERROR 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 ; Sun, 14 Dec 2025 07:58:01 +0000 (UTC) Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (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 4dTbCN3W4bz9tRK for ; Sun, 14 Dec 2025 08:57:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mabe.berlin; s=MBO0001; t=1765699072; 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=pJIT5E/6GkNYvJtfUh2gqIUblyVK5nrRp6ZqkcCdHts=; b=qzxikRVic+/OwtAodnYLUhvl9KjbbdrFib6zqUh9fmXoT78tS/l8SPaLfqpYesO/wnUamP u/8GVWgocSdJOfIIR9WblEIcUkAhJfTV6/S6agr/fasc+aUeBYKrUa5AnFvde+zIpUxG6m qqP86lSe0Ggh790Beb5SgJ2uo51azEjwk3paOvDY8qNtdKSKlXUMbk97OZ+T94CH8XnL9W SGY8x6ozO+FmIVyQAxzT98olnRoFkQliRRGqsEj3x0PZJT8ynLAhp4yK9slf0OLovW6WOV QrvSU+o1uk8YOp7DqiQe9xVwGhPow/XTrsONJw2nuU9/MTjj2a8chhVQOBzYYQ== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of marc@mabe.berlin designates 2001:67c:2050:b231:465::102 as permitted sender) smtp.mailfrom=marc@mabe.berlin Content-Type: multipart/alternative; boundary="------------Lkq7Wur2QgRwo4Pqzl1tAHa0" Message-ID: <04a1ffae-79fc-49d7-96a7-4368b932861a@mabe.berlin> Date: Sun, 14 Dec 2025 08:57:51 +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> Content-Language: en-US In-Reply-To: <6f3167c3-b6e7-4f25-8154-ce20de7d3e82@mabe.berlin> X-Rspamd-Queue-Id: 4dTbCN3W4bz9tRK From: marc@mabe.berlin ("Marc B.") This is a multi-part message in MIME format. --------------Lkq7Wur2QgRwo4Pqzl1tAHa0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi all, this is a reminder If there are still any objections about this PR please speak up. Else, I would kindly ask for merge without RFC. Thanks Marc On 29.11.25 08:14, Marc B. wrote: > > Hi all, > > I have opened a simple PR to add the possibility to include called > object in exception backtrace. > > https://github.com/php/php-src/pull/20599 > > This needs a discussion here to see if there are objections. > > About the patch: > > The patch adds the ability to populate the called |object| into > exception backtraces. > > Previously, only |debug_backtrace()| could include the called object > in its frames, but |Exception::getTrace()| could not. This change > aligns |Exception::getTrace()| with |debug_backtrace()| by introducing > a new INI directive: > > |zend.exception_provide_object (boolean)| > > This directive is analogous to the existing > |zend.exception_ignore_args| option, but controls whether the |object| > field is included in exception backtraces. > > *Behavior:* > > * When zend.exception_provide_object = 0 (default), behavior is > unchanged: exception traces do not contain the object. > * When zend.exception_provide_object = 1, exception backtrace > includes the called |object| (where applicable). > > *Defaults:* > > * No configuration value provided: |zend.exception_provide_object = Off| > * |php.ini-production|: |zend.exception_provide_object = Off| > * |php.ini-development|: |zend.exception_provide_object = On| > > *Use cases and considerations:* > This feature is primarily intended for development and debugging. > Provides richer diagnostic information by exposing the actual object > on which methods were invoked. > Can help track down state-dependent bugs that depend on specific > object properties. > > However, it is not recommended for production environments, because: > > * It may expose sensitive data held on objects in logs or error output. > * It can increase memory usage and the size of collected traces. > > For production systems, |zend.exception_provide_object| should remain > disabled. > > Additionally, I added a note to zend.exception_ignore_args and > zend.exception_provide_object as this increases the refcount of the > objects, and therefore may delay object destruction. > > Marc > --------------Lkq7Wur2QgRwo4Pqzl1tAHa0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hi all,

this is a reminder

If there are still any objections about this PR please speak up.

Else, I would kindly ask for merge without RFC.

Thanks
Marc

On 29.11.25 08:14, Marc B. wrote:

Hi all,

I have opened a simple PR to add the possibility to include called object in exception backtrace.

https://github.com/php/php-src/pull/20599

This needs a discussion here to see if there are objections.

About the patch:

The patch adds the ability to populate the called object into exception backtraces.

Previously, only debug_backtrace() could include the called object in its frames, but Exception::getTrace() could not. This change aligns Exception::getTrace() with debug_backtrace() by introducing a new INI directive:

zend.exception_provide_object (boolean)

This directive is analogous to the existing zend.exception_ignore_args option, but controls whether the object field is included in exception backtraces.

Behavior:

  • When zend.exception_provide_object = 0 (default), behavior is unchanged: exception traces do not contain the object.
  • When zend.exception_provide_object = 1, exception backtrace includes the called object (where applicable).

Defaults:

  • No configuration value provided: zend.exception_provide_object = Off
  • php.ini-production: zend.exception_provide_object = Off
  • php.ini-development: zend.exception_provide_object = On

Use cases and considerations:
This feature is primarily intended for development and debugging.
Provides richer diagnostic information by exposing the actual object on which methods were invoked.
Can help track down state-dependent bugs that depend on specific object properties.

However, it is not recommended for production environments, because:

  • It may expose sensitive data held on objects in logs or error output.
  • It can increase memory usage and the size of collected traces.

For production systems, zend.exception_provide_object should remain disabled.

Additionally, I added a note to zend.exception_ignore_args and zend.exception_provide_object as this increases the refcount of the objects, and therefore may delay object destruction.

Marc

--------------Lkq7Wur2QgRwo4Pqzl1tAHa0--