View Issue Details

IDProjectCategoryView StatusLast Update
0001163XdebugUncategorizedpublic2015-06-18 09:31
Reporterzorrocaesar Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionduplicate 
Product Version2.3.1 
Fixed in Version2.3.3 
Summary0001163: XDebug casts exception codes to integer
Description

When a class that extends \Exception overwrites the exception code with a string (this is possible and accepted according to PHP docs) is thrown, the resulting exception, when caught, will cast the string in the exception code to a integer.

Steps To Reproduce

try {
throw new ExceptionWithCodeAsString('Oops!', '5_critical')
} catch ( \Exception $e) {
var_dump $e->getCode(); // int(5)
}

Additional Information

This behavior occurs even when no XDebug session is started. Simply removing the extension, will also eliminate this behavior.

TagsNo tags attached.
Operating SystemLinux
PHP Version5.5.20-5.5.25

Relationships

duplicate of 0001133 closedderick PDO exception code value type is changed 

Activities

zorrocaesar

2015-06-18 08:31

reporter   ~0003122

This is a duplicate of: http://bugs.xdebug.org/view.php?id=1160

derick

2015-06-18 09:31

administrator   ~0003123

It's a duplicate of 0001133 too, which I've already fixed. I've verified it with your example too. Thanks for the report!