Repository navigation
Can't access array variables in interactive debug console after v1.38.0 on Mac #1075
Description
Activity
- changed the title
[-]Can't access array variables on interactive debug console after v1.38.0 on Mac[/-][+]Can't access array variables in interactive debug console after v1.38.0 on Mac[/+]on Nov 20, 2025 Thanks for the report. There might be some regressions yes. Can you share something about his code. Are you stopped inside a function or method or in global? Is
$my_arraylocal or global?Ideally, please attach a log of the session. Set
"log": truein thelaunch.jsonconfiguration you are using.I can't reproduce it. Ideally give me a short code snippet too, please.
Please also inclide Xdebug version just in case.
I was able to recreate it in both global level and inside class method. I am also using docker container and launch config below if that helps.
xdebug version: 3.1.6
$my_array = [ 'one' => 1, 'two' => 2, 'three' => 3, ]; $key = 'three';$my_array[$key] returns array(3)
log:
$my_array[$key] -> evaluateRequest { command: 'evaluate', arguments: { expression: '$my_array[$key]', frameId: 1, context: 'repl' }, type: 'request', seq: 16 } xd(1) <- context_names -i 24 -d 0 xd(1) -> <?xml version="1.0" encoding="iso-8859-1"?><response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_names" transaction_id="24"><context name="Locals" id="0"></context><context name="Superglobals" id="1"></context><context name="User defined constants" id="2"></context></response> xd(1) <- property_get -i 25 -d 0 -c 0 -n "$my_array[$key]" xd(1) -> <?xml version="1.0" encoding="iso-8859-1"?><response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="property_get" transaction_id="25"><property name="$my_array[$key]" fullname="$my_array[$key]" type="array" children="1" numchildren="3" page="0" pagesize="100"><property name="one" fullname="$my_array[$key]["one"]" type="int"><![CDATA[1]]></property><property name="two" fullname="$my_array[$key]["two"]" type="int"><![CDATA[2]]></property><property name="three" fullname="$my_array[$key]["three"]" type="int"><![CDATA[3]]></property></property></response> <- evaluateResponse Response { seq: 0, type: 'response', request_seq: 16, command: 'evaluate', success: true, body: { result: 'array(3)', variablesReference: 2 } }launch.json config:
{ "name": "Listen for Xdebug", "type": "php", "request": "launch", "hostname": "0.0.0.0", "pathMappings": { "/var/www/html/personal/v1.5.0": "${workspaceRoot}" }, "port": 9003, "log": true }Hm. This looks all ok. Will check in my mac. Whats your vscode version?
Vs code: 1.106.2
MacOS: 26.1
PHP Debug: 1.38.1Looks the same here. Are you sure you are just not seeing the response because of all the logging?
After getting back
evaluateResponse, the IDE displayes thearray(3)and an arrow to open. Imediately after this VSC evaluates the local variables so there is some other requests likescopesRequestandvariablesRequest. But when I scroll up and open the returned array, I get the relevatvariablesRequest.-> variablesRequest { command: 'variables', arguments: { variablesReference: 5 }, type: 'request', seq: 16 } <- variablesResponse Response { seq: 0, type: 'response', request_seq: 16, command: 'variables', success: true, body: { variables: [ { name: 'one', value: '1', type: 'int', variablesReference: 0, presentationHint: {}, evaluateName: '$my_array[$key]["one"]', indexedVariables: undefined }, { name: 'two', value: '2', type: 'int', variablesReference: 0, presentationHint: {}, evaluateName: '$my_array[$key]["two"]', indexedVariables: undefined }, { name: 'three', value: '3', type: 'int', variablesReference: 0, presentationHint: {}, evaluateName: '$my_array[$key]["three"]', indexedVariables: undefined } ] } }Öh! You are right. I didn't see the forest because of all the trees. I'll know what the problem is. Thanks.
- linked a pull request that will close this issuefix: Change problematic evaluate implementation #1077
on Nov 23, 2025 Should be fixed in #1077
Problem is fixed, thank you.


With v1.38.0 accessing array variables like this doesn't work anymore in debug console:
$my_array[$key]Accesing with plain string works, the problem seems accesing with another variable.
Downgrading fixed the issue