View Issue Details

IDProjectCategoryView StatusLast Update
0000806XdebugUncategorizedpublic2012-04-07 16:27
Reporternnmatveev Assigned Toderick  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionno change required 
Summary0000806: 'property_get' doesn't work if array key contains a whitespace
Description

subj

Steps To Reproduce

Consider the following code:
<?php
$x = array("a" => array(1, 2), "a b" => array(1, 2));
var_dump($x); //breakpoint here

It is impossible to get $x['a b'] content using 'property_get' command:
<- property_get -i 13 -n $x['a b'] -d 0 -c 0 -p 0
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="13"><error code="1"><message><![CDATA[parse error in command]]></message></error></response>

<- property_get -i 14 -n $x['a'] -d 0 -c 0 -p 0
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="14"><property name="$x['a']" fullname="$x['a']" address="38459768" type="array" children="1" numchildren="2" page="0" pagesize="100"><property name="0" fullname="$x['a'][0]" address="38459800" type="int"><![CDATA[1]]></property><property name="1" fullname="$x['a'][1]" address="38459832" type="int"><![CDATA[2]]></property></property></response>

Additional Information

Xdebug version: 2.1.4
PHP version: 5.3.5

related issue from PhpStorm issue tracker - http://youtrack.jetbrains.com/issue/WI-9471

TagsNo tags attached.
Attached Files
xdebug.log (19,405 bytes)
Operating SystemWindows 7
PHP Version5.3.5

Activities

derick

2012-04-07 16:27

administrator   ~0002030

This is not a bug. In order to use spaces in values you need to quote the value. This was not documented in the DBGp protocol unfortunately, but it is now:
http://xdebug.org/docs-dbgp.php#message-packets

Issue History

Date Modified Username Field Change
2012-03-27 15:14 nnmatveev New Issue
2012-03-27 15:14 nnmatveev File Added: xdebug.log
2012-04-07 16:27 derick Note Added: 0002030
2012-04-07 16:27 derick Status new => resolved
2012-04-07 16:27 derick Resolution open => no change required
2012-04-07 16:27 derick Assigned To => derick
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)
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized