View Issue Details

IDProjectCategoryView StatusLast Update
0002124XdebugStep Debuggingpublic2022-10-10 15:51
Reporterbarel Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version3.1.5 
Target Version3.2devFixed in Version3.2.0RC1 
Summary0002124: Xdebug incorrectly reports that there are no children for static closure properties, even thought there are
Description

If you have a static closure property, the children attribute in the response to the context_get message will be "0" but then the numchildren attribute will be "1" and there will be a child node with the closure data

Steps To Reproduce

This can be easily reproduced by running the xdebug/tests/debugger/bug02094.phpt test. The output of this test for the context_get command is:

<response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="4" context="0"><property name="::" fullname="::" type="object" classname="Test" children="1" numchildren="1"><property name="::bar" fullname="::bar" type="object" facet="closure static public" classname="Closure" children="0" numchildren="1" page="0" pagesize="32"><property facet="virtual readonly" name="{closure}" type="array" children="1" page="0" pagesize="2" numchildren="1"><property facet="readonly" name="function" type="string"><![CDATA[{closure}]]></property></property></property></property></response>

And it should be

 <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="4" context="0"><property name="::" fullname="::" type="object" classname="Test" children="1" numchildren="1"><property name="::bar" fullname="::bar" type="object" facet="closure static public" classname="Closure" children="1" numchildren="1" page="0" pagesize="32"><property facet="virtual readonly" name="{closure}" type="array" children="1" page="0" pagesize="2" numchildren="1"><property facet="readonly" name="function" type="string"><![CDATA[{closure}]]></property></property></property></property></response>

(the difference is in the children attribute for the ::bar property)

Additional Information

Tested in Ubuntu running under Docker in a MacOS system with PHP 8.0.19 but I suspect it happens in all PHP versions as the test is passing everywhere

Tagsdebug
Operating SystemUbuntu running under Docker in MacOS
PHP Version8.0.10-8.0.19

Activities

barel

2022-10-03 13:36

reporter   ~0006386

Sorry for the mangled XML, when I pasted it when creating the issue, it was OK, hope you can work with this

derick

2022-10-05 16:39

administrator   ~0006392

No worries about the XML - it's something the issue tracker does. When I 'edit' it shows normal.

Also, I've managed to track this down, and waiting for CI to approve the merge: https://github.com/xdebug/xdebug/pull/859 — this will go into Xdebug 3.2 and later.

Issue History

Date Modified Username Field Change
2022-10-03 13:33 barel New Issue
2022-10-03 13:33 barel Tag Attached: debug
2022-10-03 13:36 barel Note Added: 0006386
2022-10-05 16:39 derick Assigned To => derick
2022-10-05 16:39 derick Status new => assigned
2022-10-05 16:39 derick Note Added: 0006392
2022-10-05 16:39 derick Target Version => 3.2dev
2022-10-05 17:06 derick Status assigned => closed
2022-10-05 17:06 derick Resolution open => fixed
2022-10-05 17:06 derick Fixed in Version => 3.2dev
2022-10-10 15:51 derick Fixed in Version 3.2dev => 3.2.0RC1