MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001272XdebugUsage problems (Wrong Results)public2016-02-16 10:492016-12-17 20:34
ReporterSvetlanaZem 
Assigned Toderick 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version2.3.3 
Target Version2.6.0devFixed in Version2.6.0dev 
Summary0001272: property_get doesn't return attributes for SimpleXMLElement
DescriptionTry 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 ReproduceCreate 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.
Operating System
PHP Version5.6.5-5.6.9
Attached Fileslog file icon xdebug23.log [^] (43,153 bytes) 2016-02-16 10:49
log file icon xdebug22.log [^] (44,351 bytes) 2016-02-16 10:50

- Relationships

-  Notes
(0003541)
derick (administrator)
2016-03-04 15:35

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.

- 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 13:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 13: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 View Revisions
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


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker