View Issue Details

IDProjectCategoryView StatusLast Update
0000990XdebugStep Debuggingpublic2020-03-12 16:43
Reporteraik099 Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version2.2.3 
Target Version2.6.0Fixed in Version2.6.0alpha1 
Summary0000990: DBGp: Add notifications for notices and warnings
Description

I'm using PHPStorm 6.0.3 to debug an application.

There I have following code:

$a = 5;
$x = in_array('x', $a);

This would surely get me a notice/warning, that $a isn't an array. However with XDebug I'm not seeing any errors in PHPStorm console.

Additional Information

I really don't know if XDebug provides such info at all during debugging, or just only prints all traces after script has finished.

With Zend Debugger I was able to see every error in console.

Related PHPStorm issue: http://youtrack.jetbrains.com/issue/WI-13369

TagsNo tags attached.
Operating System
PHP Version5.4.10-5.4.14

Activities

aik099

2013-10-23 12:40

reporter   ~0002595

After talking with guys from PhpStorm it appears, that XDebug might not be providing such info at all. So if a line of code gets executed during step-by-step debugging and it produces an error (or several) in a result, then nothing is returned by xdebug to show that in Console.

Zend Debugger somehow managed to implement this and this is very helpful to see an error happening real time after it happens during debugger.

derick

2016-12-13 21:27

administrator   ~0004047

I've added the following to the PhpStorm issue. I don't think we need to add this though, as PhpStorm allows Notice/Warning breakpoints, that do the same thing now.

Dear PhpStorm developers, and in specific @Svetlana.Zemlyanskaya - is this something you find interesting to add to PhpStorm? In the debugging protocol, I would have to add a new [notification|https://xdebug.org/docs-dbgp.php#notifications], for example:

{code}
<notification xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" name="debug">
<xdebug:type>Warning</xdebug:type>
<xdebug:location
filename="file:///C:/Users/Nikolay.Matveev/Test/phpstorm/script_debug_test/wi5927.php"
lineno="2"/>
<xdebug:message><![CDATA[Undefined variable $x]]></xdebug:message>
</notification>
{code}

Of course, this is already sort of possible to achieve by setting a Notice or Warning breakpoint. I think PhpStorm already does this by default, which makes this feature moot...

aik099

2016-12-13 22:23

reporter   ~0004062

I was aware of Notice/Warning breakpoints, but they aren't much useful, because:

  1. you can't define them globally and have to specify them in each project you open
  2. no actual notice/warning message is shown and therefore I have to guess what might have gone wrong

derick

2016-12-15 12:06

administrator   ~0004075

OK, I've added a comment to https://youtrack.jetbrains.com/issue/WI-13369 too.

derick

2017-01-04 12:06

administrator   ~0004156

I have written to the DBGp development list with an RFC for the addition to the specification: https://xdebug.org/archives/xdebug-dev/2641.html

A preliminary Xdebug implementation is in a PR at https://github.com/xdebug/xdebug/pull/310

derick

2017-11-18 13:49

administrator   ~0004469

Fixed in GIT - thanks for playing! :-)