Hi Derick,

On 01.12.25 12:44, Rowan Tommins [IMSoP] wrote:
On 1 December 2025 10:36:51 GMT, Derick Rethans<[email protected]> 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

Reply via email to