View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002100 | Xdebug | Uncategorized | public | 2022-06-23 16:40 | 2022-11-08 13:13 |
Reporter | flack | Assigned To | derick | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 3.1.2 | ||||
Fixed in Version | 3.1.6 | ||||
Summary | 0002100: "Fatal error: debuginfo() must return an array" when Exception is thrown from debugInfo in PHP 8.x | ||||
Description | When an exception is thrown from inside a __debugInfo() function, you get a fatal error (in addition to the warning about an uncaught exception), very similar to https://bugs.xdebug.org/view.php?id=1106. Wrapping the code in a try/catch block doesn't help. Without Xdebug (or under PHP 7) it works as expected. | ||||
Steps To Reproduce |
| ||||
Tags | No tags attached. | ||||
Operating System | |||||
PHP Version | 8.0.10-8.0.19 | ||||
|
P.S.: I also think the error message is wrong. According to https://wiki.php.net/rfc/magic-methods-signature The return type for __debugInfo is ?array, so null should also be valid |
|
I get similar results whether Xdebug is enabled or not, on PHP 8.0.21, 8.1.9, and 7.4.29. Without Xdebug:
With Xdebug:
The fatal error comes from PHP itself, so I can't control the output, and I also think it's the right result, as you're not returning an array at all, because you're not returning anything from |
|
Hm, strange. On Linux, I also see the behavior you describe, but on macOS (PHP from Homebrew) it behaved as I described in the OP. Here is a modified testcase that only fails when XDebug is enabled: |
|
This might be related: https://github.com/php/php-src/issues/7922 |
|
I can reproduce it with your new case, and I have a "hack" PR that disables using |
|
|
Date Modified | Username | Field | Change |
---|---|---|---|
2022-06-23 16:40 | flack | New Issue | |
2022-06-23 17:30 | flack | Note Added: 0006334 | |
2022-06-27 09:58 | derick | Assigned To | => derick |
2022-06-27 09:58 | derick | Status | new => feedback |
2022-06-27 09:58 | derick | Note Added: 0006336 | |
2022-06-27 12:08 | flack | Note Added: 0006337 | |
2022-06-27 12:08 | flack | Status | feedback => assigned |
2022-06-27 20:00 | flack | Note Added: 0006338 | |
2022-06-28 15:36 | derick | Note Edited: 0006337 | |
2022-06-29 14:34 | derick | Steps to Reproduce Updated | |
2022-06-29 14:35 | derick | Note Added: 0006341 | |
2022-07-13 18:03 | derick | Status | assigned => closed |
2022-07-13 18:03 | derick | Resolution | open => fixed |
2022-07-13 18:03 | derick | Fixed in Version | => 3.1dev |
2022-07-13 18:03 | derick | Note Added: 0006345 | |
2022-11-08 13:13 | derick | Fixed in Version | 3.1dev => 3.1.6 |