View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001133 | Xdebug | Uncategorized | public | 2015-03-31 02:15 | 2015-03-31 09:53 |
Reporter | troydavisson | Assigned To | derick | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | Linux | OS | Fedora | OS Version | Fedora 21 |
Product Version | 2.3.1 | ||||
Fixed in Version | 2.3.3 | ||||
Summary | 0001133: PDO exception code value type is changed | ||||
Description | Running PHP 5.6.6 with Xdebug enabled, executing a PDO query which causes an exception to be thrown causes the value returned by $e->getCode() to have it's type changed. Running PHP 5.5.* with Xdebug enabled does not produce the same result, suggesting a recent change. | ||||
Steps To Reproduce | With Xdebug enabled, execute: <?php try { Disable Xdebug and execute again. With Xdebug on, the exception code is int(0). With Xdebug disabled, it's string(5) "HY000" | ||||
Additional Information | A slightly more realistic example against MySQL (all other code the same) returns: string(5) "42S02" with Xdebug disabled and: int(42) with Xdebug enabled, suggesting that there's extra value casting happening now that didn't exist in prior versions. | ||||
Tags | No tags attached. | ||||
Operating System | Fedora 21 | ||||
PHP Version | 5.6.0-5.6.4 | ||||
|
No need for PDO here, this also fails: php -r 'try { throw new Exception("foo", "42GG"); } catch (Exception $e) { echo $e->getCode(), "\n"; }' echos: 42 -- I see what the problem is. "Just" need to fix it now. |
|
It was PDO specific after all, as the standard Exception requires "code" to be an integer. I've fixed it for 2.3.3/3.0.0. Thanks for the report! |
Date Modified | Username | Field | Change |
---|---|---|---|
2015-03-31 02:15 | troydavisson | New Issue | |
2015-03-31 09:05 | derick | Note Added: 0003054 | |
2015-03-31 09:05 | derick | Assigned To | => derick |
2015-03-31 09:05 | derick | Status | new => assigned |
2015-03-31 09:53 | derick | Note Added: 0003055 | |
2015-03-31 09:53 | derick | Status | assigned => closed |
2015-03-31 09:53 | derick | Resolution | open => fixed |
2015-03-31 09:53 | derick | Fixed in Version | => 2.3.3 |
2015-06-18 09:31 | derick | Relationship added | has duplicate 0001163 |
2015-06-18 09:32 | derick | Relationship added | has duplicate 0001160 |
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 |