View Issue Details

IDProjectCategoryView StatusLast Update
0000476XdebugUncategorizedpublic2023-11-30 14:49
Reporterhermanradtke Assigned Toderick  
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

Issue History

Date Modified Username Field Change
2009-10-20 18:16 hermanradtke New Issue
2009-10-20 18:16 hermanradtke Operating System => CentOS
2009-10-20 18:16 hermanradtke PHP Version => 5.3.0
2009-10-20 18:16 hermanradtke Xdebug Version => 2.0.5
2009-11-21 17:54 hermanradtke Note Added: 0001145
2009-11-21 17:56 hermanradtke Note Edited: 0001145
2009-11-22 14:49 derick Note Added: 0001149
2009-11-22 14:49 derick Status new => closed
2009-11-22 14:49 derick Resolution open => fixed
2016-07-31 12:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 12:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized
2023-08-23 10:31 derick Assigned To => derick
2023-08-23 10:31 derick Status closed => confirmed
2023-08-23 10:31 derick Note Added: 0006635
2023-08-23 10:32 derick Target Version => 3.3dev
2023-08-23 10:32 derick PHP Version 5.3.0 => 8.2.0-8.2.9
2023-08-23 10:32 derick Summary Xdebug 2.0.5 does not properly work with exception chaining => Exception chaining does not work properly
2023-08-23 11:38 derick Status confirmed => closed
2023-08-23 11:38 derick Fixed in Version => 3.3dev
2023-08-23 11:38 derick Note Added: 0006639
2023-09-05 17:46 derick Fixed in Version 3.3dev => 3.3.0alpha1
2023-11-30 14:49 derick Fixed in Version 3.3.0alpha1 => 3.3.0