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 | derick | ||
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. | ||||
Attached Files | xdebug_with_notify.log (13,202 bytes)
Log opened at 2018-11-12 12:08:17 I: Connecting to configured address/port: localhost:9000. W: Creating socket for 'localhost:9000', poll success, but error: Operation now in progress (29). I: Connected to client. :-) -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///home/user/PhpstormProjects/debugger/debug_console/debug/withNotice.php" language="PHP" xdebug:language_version="7.1.1" protocol_version="1.0" appid="12314" idekey="PHPSTORM"><engine version="2.6.0"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2018 by Derick Rethans]]></copyright></init> <- feature_set -i 1 -n show_hidden -v 1 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="1" feature="show_hidden" success="1"></response> <- feature_set -i 2 -n max_depth -v 1 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="max_depth" success="1"></response> <- feature_set -i 3 -n max_children -v 100 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="3" feature="max_children" success="1"></response> <- feature_set -i 4 -n extended_properties -v 1 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="4" feature="extended_properties" success="1"></response> <- feature_set -i 5 -n notify_ok -v 1 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="5" feature="notify_ok" success="1"></response> <- stdout -i 6 -c 1 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stdout" transaction_id="6" success="1"></response> <- status -i 7 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="status" transaction_id="7" status="starting" reason="ok"></response> <- step_into -i 8 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="8" status="break" reason="ok"><xdebug:message filename="file:///home/user/PhpstormProjects/debugger/debug_console/debug/withNotice.php" lineno="3"></xdebug:message></response> <- eval -i 9 -- aXNzZXQoJF9TRVJWRVJbJ1BIUF9JREVfQ09ORklHJ10p -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="9"><property type="bool"><![CDATA[0]]></property></response> <- eval -i 10 -- aXNzZXQoJF9TRVJWRVJbJ1NFUlZFUl9OQU1FJ10p -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="10"><property type="bool"><![CDATA[1]]></property></response> <- eval -i 11 -- KHN0cmluZykoJF9TRVJWRVJbJ1NFUlZFUl9OQU1FJ10p -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="11"><property type="string" size="9" encoding="base64"><![CDATA[MTI3LjAuMC4x]]></property></response> <- eval -i 12 -- KHN0cmluZykoJF9TRVJWRVJbJ1NFUlZFUl9QT1JUJ10p -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="12"><property type="string" size="4" encoding="base64"><![CDATA[ODA4MQ==]]></property></response> <- eval -i 13 -- KHN0cmluZykoJF9TRVJWRVJbJ1JFUVVFU1RfVVJJJ10p -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="13"><property type="string" size="21" encoding="base64"><![CDATA[L2RlYnVnL3dpdGhOb3RpY2UucGhw]]></property></response> <- breakpoint_set -i 14 -t line -f file:///home/user/PhpstormProjects/debugger/debug_console/hello.php -n 7 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="14" id="123140001"></response> <- breakpoint_set -i 15 -t line -f file:///home/user/PhpstormProjects/debugger/debug_console/hello.php -n 44 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="15" id="123140002"></response> <- breakpoint_set -i 16 -t line -f file:///home/user/PhpstormProjects/debugger/debug_console/debug/withNotice.php -n 3 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="16" id="123140003"></response> <- stack_get -i 17 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="17"><stack where="{main}" level="0" type="file" filename="file:///home/user/PhpstormProjects/debugger/debug_console/debug/withNotice.php" lineno="3"></stack></response> <- stack_get -i 18 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="18"><stack where="{main}" level="0" type="file" filename="file:///home/user/PhpstormProjects/debugger/debug_console/debug/withNotice.php" lineno="3"></stack></response> <- context_names -i 19 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_names" transaction_id="19"><context name="Locals" id="0"></context><context name="Superglobals" id="1"></context><context name="User defined constants" id="2"></context></response> <- context_get -i 20 -d 0 -c 0 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="20" context="0"><property name="$err_level" fullname="$err_level" type="uninitialized"></property><property name="$x" fullname="$x" type="uninitialized"></property></response> <- context_get -i 21 -d 0 -c 1 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="21" context="1"><property name="$_COOKIE" fullname="$_COOKIE" type="array" children="1" numchildren="6" page="0" pagesize="100"><property name="debug_session_id" fullname="$_COOKIE["debug_session_id"]" type="string" size="8" encoding="base64"><![CDATA[ODM3MTk5MDA=]]></property><property name="debug_start_session" fullname="$_COOKIE["debug_start_session"]" type="string" size="1" encoding="base64"><![CDATA[MQ==]]></property><property name="ZDEDebuggerPresent" fullname="$_COOKIE["ZDEDebuggerPresent"]" type="string" size="14" encoding="base64"><![CDATA[cGhwLHBodG1sLHBocDM=]]></property><property name="ZendDebuggerCookie" fullname="$_COOKIE["ZendDebuggerCookie"]" type="string" size="40" encoding="base64"><![CDATA[MTI3LjAuMC4xOjEwMTM3OjB8fDA0Q3w3Nzc0MkQ2NXw4MzcxOTkwMA==]]></property><property name="prof_profiler_enabled" fullname="$_COOKIE["prof_profiler_enabled"]" type="string" size="1" encoding="base64"><![CDATA[MQ==]]></property><property name="XDEBUG_SESSION" fullname="$_COOKIE["XDEBUG_SESSION"]" type="string" size="8" encoding="base64"><![CDATA[UEhQU1RPUk0=]]></property></property><property name="$_ENV" fullname="$_ENV" type="array" children="0" numchildren="0" page="0" pagesize="100"></property><property name="$_FILES" fullname="$_FILES" type="array" children="0" numchildren="0" page="0" pagesize="100"></property><property name="$_GET" fullname="$_GET" type="array" children="0" numchildren="0" page="0" pagesize="100"></property><property name="$_POST" fullname="$_POST" type="array" children="0" numchildren="0" page="0" pagesize="100"></property><property name="$_REQUEST" fullname="$_REQUEST" type="array" children="0" numchildren="0" page="0" pagesize="100"></property><property name="$_SERVER" fullname="$_SERVER" type="array" children="1" numchildren="23" page="0" pagesize="100"><property name="DOCUMENT_ROOT" fullname="$_SERVER["DOCUMENT_ROOT"]" type="string" size="50" encoding="base64"><![CDATA[L2hvbWUvdXNlci9QaHBzdG9ybVByb2plY3RzL2RlYnVnZ2VyL2RlYnVnX2NvbnNvbGU=]]></property><property name="REMOTE_ADDR" fullname="$_SERVER["REMOTE_ADDR"]" type="string" size="9" encoding="base64"><![CDATA[MTI3LjAuMC4x]]></property><property name="REMOTE_PORT" fullname="$_SERVER["REMOTE_PORT"]" type="string" size="5" encoding="base64"><![CDATA[NTQ2Njg=]]></property><property name="SERVER_SOFTWARE" fullname="$_SERVER["SERVER_SOFTWARE"]" type="string" size="28" encoding="base64"><![CDATA[UEhQIDcuMS4xIERldmVsb3BtZW50IFNlcnZlcg==]]></property><property name="SERVER_PROTOCOL" fullname="$_SERVER["SERVER_PROTOCOL"]" type="string" size="8" encoding="base64"><![CDATA[SFRUUC8xLjE=]]></property><property name="SERVER_NAME" fullname="$_SERVER["SERVER_NAME"]" type="string" size="9" encoding="base64"><![CDATA[MTI3LjAuMC4x]]></property><property name="SERVER_PORT" fullname="$_SERVER["SERVER_PORT"]" type="string" size="4" encoding="base64"><![CDATA[ODA4MQ==]]></property><property name="REQUEST_URI" fullname="$_SERVER["REQUEST_URI"]" type="string" size="21" encoding="base64"><![CDATA[L2RlYnVnL3dpdGhOb3RpY2UucGhw]]></property><property name="REQUEST_METHOD" fullname="$_SERVER["REQUEST_METHOD"]" type="string" size="3" encoding="base64"><![CDATA[R0VU]]></property><property name="SCRIPT_NAME" fullname="$_SERVER["SCRIPT_NAME"]" type="string" size="21" encoding="base64"><![CDATA[L2RlYnVnL3dpdGhOb3RpY2UucGhw]]></property><property name="SCRIPT_FILENAME" fullname="$_SERVER["SCRIPT_FILENAME"]" type="string" size="71" encoding="base64"><![CDATA[L2hvbWUvdXNlci9QaHBzdG9ybVByb2plY3RzL2RlYnVnZ2VyL2RlYnVnX2NvbnNvbGUvZGVidWcvd2l0aE5vdGljZS5waHA=]]></property><property name="PHP_SELF" fullname="$_SERVER["PHP_SELF"]" type="string" size="21" encoding="base64"><![CDATA[L2RlYnVnL3dpdGhOb3RpY2UucGhw]]></property><property name="HTTP_HOST" fullname="$_SERVER["HTTP_HOST"]" type="string" size="14" encoding="base64"><![CDATA[MTI3LjAuMC4xOjgwODE=]]></property><property name="HTTP_CONNECTION" fullname="$_SERVER["HTTP_CONNECTION"]" type="string" size="10" encoding="base64"><![CDATA[a2VlcC1hbGl2ZQ==]]></property><property name="HTTP_CACHE_CONTROL" fullname="$_SERVER["HTTP_CACHE_CONTROL"]" type="string" size="9" encoding="base64"><![CDATA[bWF4LWFnZT0w]]></property><property name="HTTP_UPGRADE_INSECURE_REQUESTS" fullname="$_SERVER["HTTP_UPGRADE_INSECURE_REQUESTS"]" type="string" size="1" encoding="base64"><![CDATA[MQ==]]></property><property name="HTTP_USER_AGENT" fullname="$_SERVER["HTTP_USER_AGENT"]" type="string" size="105" encoding="base64"><![CDATA[TW96aWxsYS81LjAgKFgxMTsgTGludXggeDg2XzY0KSBBcHBsZVdlYktpdC81MzcuMzYgKEtIVE1MLCBsaWtlIEdlY2tvKSBDaHJvbWUvNjkuMC4zNDk3LjEwMCBTYWZhcmkvNTM3LjM2]]></property><property name="HTTP_ACCEPT" fullname="$_SERVER["HTTP_ACCEPT"]" type="string" size="85" encoding="base64"><![CDATA[dGV4dC9odG1sLGFwcGxpY2F0aW9uL3hodG1sK3htbCxhcHBsaWNhdGlvbi94bWw7cT0wLjksaW1hZ2Uvd2VicCxpbWFnZS9hcG5nLCovKjtxPTAuOA==]]></property><property name="HTTP_ACCEPT_ENCODING" fullname="$_SERVER["HTTP_ACCEPT_ENCODING"]" type="string" size="17" encoding="base64"><![CDATA[Z3ppcCwgZGVmbGF0ZSwgYnI=]]></property><property name="HTTP_ACCEPT_LANGUAGE" fullname="$_SERVER["HTTP_ACCEPT_LANGUAGE"]" type="string" size="50" encoding="base64"><![CDATA[ZW4tVVMsZW47cT0wLjksZXM7cT0wLjgsZnI7cT0wLjcscnU7cT0wLjYsZGU7cT0wLjU=]]></property><property name="HTTP_COOKIE" fullname="$_SERVER["HTTP_COOKIE"]" type="string" size="198" encoding="base64"><![CDATA[ZGVidWdfc2Vzc2lvbl9pZD04MzcxOTkwMDsgZGVidWdfc3RhcnRfc2Vzc2lvbj0xOyBaREVEZWJ1Z2dlclByZXNlbnQ9cGhwLHBodG1sLHBocDM7IFplbmREZWJ1Z2dlckNvb2tpZT0xMjcuMC4wLjElM0ExMDEzNyUzQTB8fDA0Q3w3Nzc0MkQ2NXw4MzcxOTkwMDsgcHJvZl9wcm9maWxlcl9lbmFibGVkPTE7IFhERUJVR19TRVNTSU9OPVBIUFNUT1JN]]></property><property name="REQUEST_TIME_FLOAT" fullname="$_SERVER["REQUEST_TIME_FLOAT"]" type="float"><![CDATA[1542024497.6028]]></property><property name="REQUEST_TIME" fullname="$_SERVER["REQUEST_TIME"]" type="int"><![CDATA[1542024497]]></property></property></response> <- context_get -i 22 -d 0 -c 2 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="22" context="2"></response> <- run -i 23 -> <notify xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" name="error"><xdebug:message filename="file:///home/user/PhpstormProjects/debugger/debug_console/debug/withNotice.php" lineno="6" type="Notice"><![CDATA[Undefined variable: x]]></xdebug:message></notify> -> <stream xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" type="stdout" encoding="base64"><![CDATA[YWxsIGRvbmUK]]></stream> -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="23" status="stopping" reason="ok"></response> <- run -i 24 Log closed at 2018-11-12 12:08:22 | ||||
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. |
Date Modified | Username | Field | Change |
---|---|---|---|
2018-11-12 12:18 | LanaZem | New Issue | |
2018-11-12 12:18 | LanaZem | File Added: xdebug_with_notify.log | |
2018-12-01 11:28 | derick | Note Added: 0004733 | |
2018-12-02 18:45 | derick | Assigned To | => derick |
2018-12-02 18:45 | derick | Status | new => feedback |
2018-12-03 10:30 | LanaZem | Note Added: 0004742 | |
2018-12-03 10:30 | LanaZem | Status | feedback => assigned |
2019-01-22 22:30 | derick | Note Added: 0004836 | |
2019-01-22 22:30 | derick | Status | assigned => resolved |
2019-01-22 22:30 | derick | Resolution | open => no change required |
2019-05-02 14:38 | LanaZem | Note Added: 0005011 | |
2019-05-02 15:05 | derick | Status | resolved => acknowledged |
2019-05-02 15:05 | derick | Note Added: 0005012 | |
2019-05-06 06:01 | derick | Note Added: 0005017 | |
2019-05-06 06:01 | derick | Note Edited: 0005011 | |
2019-05-06 09:28 | derick | Summary | Error notifier doesn't respect error_reporting level => error_reporting()'s return value is incorrect during debugger's 'eval' command |
2019-05-06 09:28 | derick | Steps to Reproduce Updated | |
2019-05-06 09:37 | derick | Status | acknowledged => closed |
2019-05-06 09:37 | derick | Fixed in Version | => 2.7.0dev |
2019-05-06 09:37 | derick | Note Added: 0005018 | |
2019-05-06 09:38 | derick | Resolution | no change required => fixed |
2019-05-06 15:46 | derick | Fixed in Version | 2.7.0dev => 2.7.2 |
2019-11-12 13:21 | cljk | Note Added: 0005178 | |
2019-11-12 13:56 | derick | Note Added: 0005179 | |
2020-03-12 16:35 | derick | Category | Usage problems (Wrong Results) => Variable Display |
2020-03-12 16:38 | derick | Category | Variable Display => Uncategorized |