View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001586 | Xdebug | Uncategorized | public | 2018-11-12 12:18 | 2019-11-12 13:56 |
| Reporter | LanaZem | Assigned To | |||
| Priority | normal | Severity | minor | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Product Version | 2.6.0 | ||||
| Fixed in Version | 2.7.2 | ||||
| Summary | 0001586: error_reporting()'s return value is incorrect during debugger's 'eval' command | ||||
| Description | Xdebug sends error notification even if they are disabled in php.ini | ||||
| Steps To Reproduce | 1) Set error_reporting to
3) Make sure that regular execution doesn't generate PHP Notification 4) Start Xdebug debug session 5) Enable notify feature
6) Finish debug session 7) Note that there's a notification in xdebug log:
| ||||
| Additional Information | PhpStorm issue: https://youtrack.jetbrains.com/issue/WI-43921 | ||||
| Tags | No tags attached. | ||||
| Operating System | |||||
| PHP Version | 7.1.0-7.1.4 | ||||
|
|
I saw the issue when you submitted it, but so far I had neglected to reply as I am unsure whether Xdebug is doing anything wrong here. I'm going to argue that it doesn't. As Xdebug is a debugging tool, it should provide as much information as it can. When an IDE sets the The DBGp specification says:
The language engine (PHP) creates a debugging notice (including formatting, stack traces, etc) regardless of whether PHP outputs it to the screen. The decision to show debugging information is taken much later. This means that leaving many notices unfixed in your PHP script actually creates quite a slow down to begin with (even if Xdebug is not involved at all). As a debugging notice is created, Xdebug decides to send it over the DBGp connection to the IDE, to point out that there is a mistake in the script. I would say that it should continue to do so. |
|
|
Thank you for the answer! We'll think how it should be fixed on PhpStorm side. Probably we should show error according to error level but notify user if there are too much hidden notifications and warnings. |
|
|
Thanks Svetlana. I'll close the issue for now. If we can come up with a better solution in the future, then we can create a new issue for it. cheers, |
|
|
My colleague is currently looking how can we fix this issue on IDE side and we can't find a good way to find error reporting level for a current debug process. Is there more appropriate way to get the error_reporting level during debugging ? To reproduce:
2) Place a breakpoint on lines 7 and 12. In both cases, evaluating 'error_reporting()' will return 0. xdebug.log:
|
|
|
I'll have a look again. |
|
|
I've found out why your eval statement returns |
|
|
This is now fixed in the xdebug_2_7 and master branches. |
|
|
Is it possible that this bug is still unfixed in 2.8? I´m debugging with IntelliJ Ultimate 2019.2 and Xdebug 2.8.0 on Windows PHP 7.3 x64 (VC15). IntelliJ outputs a lot of garbace (NOTICEs) when in debugging mode - despite it should not... |
|
|
@cljk Your comment is unrelated to this report. This report is about error_reporting() returning the wrong value. The youtrack issue that you linked to explains why these extra notices are not a bug in Xdebug. |