View Issue Details

IDProjectCategoryView StatusLast Update
0001272XdebugUncategorizedpublic2017-12-02 18:36
ReporterSvetlanaZem Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version2.3.3 
Target Version2.6.0Fixed in Version2.6.0alpha1 
Summary0001272: property_get doesn't return attributes for SimpleXMLElement
Description

Try to get attributes for SimpleXmlElement, i.e. $e = new SimpleXmlElement($xml); get value for $e->@attributes.

Xdebug 2.3.3 response as there are no children:

<- property_get -i 19 -n $e->@attributes -d 0 -c 0 -p 0
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="19"><property name="$e->@attributes" fullname="$e->@attributes" address="139846350792976" type="object" classname="SimpleXMLElement" children="0" numchildren="0" page="0" pagesize="100"></property></response>

While Xdebug 2.2.6 successfully returns child attributes:

<- property_get -i 17 -n $e->@attributes -d 0 -c 0 -p 0
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="17"><property name="$e->@attributes" fullname="$e->@attributes" address="139821914260288" type="array" children="1" numchildren="1" page="0" pagesize="100"><property name="att1" fullname="$e->@attributes['att1']" address="139821914260336" type="string" size="5" encoding="base64"><![CDATA[YXR0LWE=]]></property></property></response>

Steps To Reproduce

Create code:
<?php

$xml = "<a att1='att-a'><b attb='attb-1'><b attb='attb-2'></a>";

$e = new SimpleXmlElement($xml);

foreach($e->b as $b) { // breakpoint here
echo $b['attb'].PHP_EOL;
}

1) Stop on breakpoint
2) Get value of "$e->@attributes" with property_get command

Expected:
Value of $e->@attributes is returned

Actual:
No child values

TagsNo tags attached.
Attached Files
xdebug23.log (43,153 bytes)   
xdebug22.log (44,351 bytes)   
Operating System
PHP Version5.6.5-5.6.9

Activities

derick

2016-03-04 15:35

administrator   ~0003541

Just a note that I started working on it. It works for PHP 7 and later now again, but not yet for PHP 5.x, so I haven't merged it yet.

hpikkemaat

2017-10-31 10:58

reporter   ~0004446

Derick do you have an update on this issue?

Issue History

Date Modified Username Field Change
2016-02-16 10:49 SvetlanaZem New Issue
2016-02-16 10:49 SvetlanaZem File Added: xdebug23.log
2016-02-16 10:50 SvetlanaZem File Added: xdebug22.log
2016-03-04 15:35 derick Note Added: 0003541
2016-07-31 12:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 12:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)
2016-12-04 15:20 derick Assigned To => derick
2016-12-04 15:20 derick Status new => assigned
2016-12-12 00:17 derick Target Version => 2.6.0dev
2016-12-12 00:17 derick Description Updated
2016-12-17 20:34 derick Status assigned => closed
2016-12-17 20:34 derick Resolution open => fixed
2016-12-17 20:34 derick Fixed in Version => 2.6.0dev
2017-10-31 10:58 hpikkemaat Note Added: 0004446
2017-12-02 15:57 derick Fixed in Version 2.6.0dev => 2.6.0alpha1
2017-12-02 18:34 derick Target Version 2.6.0dev => 2.6.0alpha1
2017-12-02 18:36 derick Target Version 2.6.0alpha1 => 2.6.0
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized