View Issue Details

IDProjectCategoryView StatusLast Update
0000476XdebugUncategorizedpublic2023-11-30 14:49
Reporterhermanradtke Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Target Version3.3devFixed in Version3.3.0 
Summary0000476: Exception chaining does not work properly
Description

Hi Derick,

I asked you a question about xdebug's support of 5.3's exception
chaining at the CodeWorks talk in LA.

Here is a quick example of what I mean:

<?php
try {
throw new Exception('First exception');
} catch(Exception $e) {
throw new Exception('Second exception', 0, $e);
}

Run this code on a web page with xdebug installed. You will notice
the first exception is completely ignored.

Call xdebug_disable() at the top of my example script above and you
will see that the standard exception message is something like:

Fatal error: Uncaught exception 'Exception' with message 'First
exception' in /home/hradtke/public/chain.php:5 Stack trace: #0 {main}
Next exception 'Exception' with message 'Second exception' in
/home/hradtke/public/chain.php:7 Stack trace: #0 {main} thrown in
/home/hradtke/public/chain.php on line 7

The documentation shows the third parameter at:
http://www.php.net/manual/en/class.exception.php . Unfortunately, the
docs don't highlight that as a PHP 5.3 only change.

TagsNo tags attached.
Operating SystemCentOS
PHP Version8.2.0-8.2.9

Activities

hermanradtke

2009-11-21 17:54

reporter   ~0001145

Last edited: 2009-11-21 17:56

Patch for this issue:

http://www.hermanradtke.com/patches/xdebug-476-exception_chaining.patch

derick

2009-11-22 14:49

administrator   ~0001149

I've just fixed this in CVS, but a patch that I've been working on for a bit as well. Mine also refactors the table generating and proper formatting of all errors into one table.

derick

2023-08-23 10:31

administrator   ~0006635

This appeared again since PHP 8.2, as it does not allow for writing to undeclared properties without warning. Hence, a new method needs to be implemented.

derick

2023-08-23 11:38

administrator   ~0006639

https://github.com/xdebug/xdebug/pull/903