View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001483 | Xdebug | Uncategorized | public | 2017-10-26 02:44 | 2019-12-08 07:32 |
| Reporter | claude.bing | Assigned To | |||
| Priority | normal | Severity | major | Reproducibility | always |
| Status | resolved | Resolution | no change required | ||
| Platform | Linux | OS | Ubuntu | OS Version | 16.04.3 LTS |
| Product Version | 2.5.5 | ||||
| Summary | 0001483: Some function calls return NULL only when XDebug is enabled | ||||
| Description | When I have XDebug enabled, a function call that is meant to return an array of objects will instead return NULL. If I disable XDebug, var_dump($variable); will return the correct information. The gist link in "Additional information" has two comments with output of var_dump() both with and without XDebug enabled. | ||||
| Additional Information | https://gist.github.com/meinemitternacht/7838344bef9db1988bca9a8c8c4af165 It is not selectable in the list, but I am using PHP 7.1.10 | ||||
| Tags | No tags attached. | ||||
| Operating System | Ubuntu 16.04.3 LTS | ||||
| PHP Version | 7.3.5-7.3.9 | ||||
|
|
Please attach the code as a file here, so I can have a look when I'm offline too. |
|
|
Can't reproduce this, and no feedback provided. |
|
|
Sorry I abandoned this issue, I got sidetracked with a lot of things. I have reproduced this issue with the same project, but with a different OS version, PHP version, and Xdebug version. Similar to the original issue, the function returns an array of items, and adding a breakpoint in the function causes it to return null. If I do not add a breakpoint, it works fine. Can you give me a list of things that would be most useful to you in order to debug the issue? Some sort of log from Xdebug, package versions, etc. |
|
|
I have (possibly) narrowed it down to closing a mysqli prepared statement before returning a value from the function. If I add a breakpoint after $stmt->close(), the function will return null. If I remove my container from the script, it produces a different problem entirely:
Value of the $stmt variable in PhpStorm: |
|
|
|
|
|
The last thing I think is relevant is that the problem can be reproduced without the container if I register a custom error handler: |
|
|
I believe it is this PHP bug that causes the issue: https://bugs.php.net/bug.php?id=67348&edit=1 — this got fixed in https://github.com/php/php-src/commit/579562176b71820ad49d43b2c841642fef12fe57 for PHP 7.4. As this is technically a BC break, it was not merge back to older PHP versions. If you could try the latest 7.4.0RC1 version to test whether it solved this problem, that'd be great! If not, then I suggest we close the issue as I'm relatively sure, this is the cause of your issue. |
|
|
I will give this a shot and let you know how it goes! |
|
|
Did you give this a go yet? |
|
|
I'm closing this, as I believe this has been fixed in PHP 7.4. This was also never an issue in Xdebug either. |